PerfectlySoft / PerfectlySoft/Perfect-SQLite
Making closure parameters non-escaping where possible (forEachRow etc)
Open
@kjessup is already working on this.
Since Jul 3, 2016.
- Dominant language
- Swift
- Stars
- 50
- Forks
- 18
- Avg merge
- 24m
- Merged PRs (30d)
- 1
Description
Please consider marking closures in methods such as forEachRow non escaping (@noescape attribute). They aren't capturing the closure anyway, but if this attribute is absent, closure requires prefixing member references with explicit 'self.'
try DB.connection.forEachRow(statement: "SELECT * FROM topics_files WHERE user_id = ?", doBindings: { statement in
try statement.bind(position: 0, self.userId!) // <---- self.
}) { statement, row in
self.topicsData = statement.columnBlob(position: 0) // <---- self.
}
public func forEachRow(statement: String, doBindings: @noescape (SQLiteStmt) throws -> (), handleRow: @noescape (SQLiteStmt, Int) -> ()) throws {}
...
func forEachRowBody(stat: SQLiteStmt, handleRow: @noescape (SQLiteStmt, Int) -> ()) throws {}
...
etc
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.