Skip to content

Commit

Permalink
More inlinable
Browse files Browse the repository at this point in the history
...
  • Loading branch information
helje5 committed Dec 8, 2024
1 parent 5d71e3a commit ee8f023
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/ZeeQL/Access/Attribute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -418,20 +418,23 @@ open class ModelAttribute : Attribute, Equatable {

public extension Attribute {

@inlinable
func eq(_ attr: Attribute) -> KeyComparisonQualifier {
let key = AttributeKey(self)
let otherKey = AttributeKey(attr)
return KeyComparisonQualifier(key, .EqualTo, otherKey)
}

@inlinable
func eq(_ value : Any?) -> KeyValueQualifier {
let key = AttributeKey(self)
return KeyValueQualifier(key, .EqualTo, value)
}
}

public extension Attribute {


@inlinable
func like(_ pattern : String) -> KeyValueQualifier {
let key = AttributeKey(self)
return KeyValueQualifier(key, .Like, pattern)
Expand Down
1 change: 1 addition & 0 deletions Sources/ZeeQL/Access/AttributeKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
public struct AttributeKey : Key, Equatable {

@inlinable
public var key : String { return attribute.name }

public let entity : Entity?
Expand Down

0 comments on commit ee8f023

Please sign in to comment.