PerfectlySoft / PerfectlySoft/Perfect-SQLite

Making closure parameters non-escaping where possible (forEachRow etc)

Open
#2 1 comment 0 reactions 1 assignee View on GitHub

@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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.