Skip to content

Commit 41ed510

Browse files
committed
[Operators] Make OpeatorTable.standardOperators a stored property
Building standard operator table is not trivial. Make is an immutable stored property so it stays in memory once it's initialized.
1 parent 04d2d0c commit 41ed510

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/SwiftOperators/OperatorTable+Defaults.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ extension OperatorTable {
6464
/// without requiring access to the standard library source code. However,
6565
/// because it does not incorporate user-defined operators, it will only
6666
/// ever be useful for a quick approximation.
67-
public static var standardOperators: OperatorTable {
67+
public static let standardOperators: OperatorTable = {
6868
let precedenceGroups: [PrecedenceGroup] = [
6969
PrecedenceGroup(
7070
name: "AssignmentPrecedence",
@@ -437,5 +437,5 @@ extension OperatorTable {
437437
precedenceGroups: precedenceGroups,
438438
operators: operators
439439
)
440-
}
440+
}()
441441
}

0 commit comments

Comments
 (0)