Skip to content

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

@zmeyc

Description

@zmeyc

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions