Skip to content

Commit d02c044

Browse files
committed
remove backpointer to parent
1 parent aaa7855 commit d02c044

File tree

4 files changed

+11
-22
lines changed

4 files changed

+11
-22
lines changed

Firestore/Swift/Source/ExpressionImplementation.swift

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ extension Expression {
225225
func bitRightShift(_ numberExpression: Expression) -> FunctionExpression {
226226
return FunctionExpression("bit_right_shift", [self, numberExpression])
227227
}
228-
228+
229229
/// Calculates the Manhattan (L1) distance between this vector expression and another vector
230230
/// expression.
231231
/// Assumes both `self` and `other` evaluate to Vectors.
@@ -271,7 +271,7 @@ extension Expression {
271271
func manhattanDistance(_ vector: [Double]) -> FunctionExpression {
272272
return FunctionExpression("manhattan_distance", [self, Helper.sendableToExpr(vector)])
273273
}
274-
274+
275275
/// Creates an expression that replaces the first occurrence of a literal substring within this
276276
/// string expression with another literal substring.
277277
/// Assumes `self` evaluates to a string.
@@ -284,7 +284,7 @@ extension Expression {
284284
/// - Parameter find: The literal string substring to search for.
285285
/// - Parameter replace: The literal string substring to replace the first occurrence with.
286286
/// - Returns: A new `FunctionExpr` representing the string with the first occurrence replaced.
287-
func replaceFirst(_ find: String, with replace: String) -> FunctionExpression{
287+
func replaceFirst(_ find: String, with replace: String) -> FunctionExpression {
288288
return FunctionExpression(
289289
"replace_first",
290290
[self, Helper.sendableToExpr(find), Helper.sendableToExpr(replace)]
@@ -304,7 +304,7 @@ extension Expression {
304304
/// - Parameter replace: An `Expr` (evaluating to a string) for the substring to replace the first
305305
/// occurrence with.
306306
/// - Returns: A new `FunctionExpr` representing the string with the first occurrence replaced.
307-
func replaceFirst(_ find: Expression, with replace: Expression) -> FunctionExpression{
307+
func replaceFirst(_ find: Expression, with replace: Expression) -> FunctionExpression {
308308
return FunctionExpression("replace_first", [self, find, replace])
309309
}
310310

@@ -320,7 +320,7 @@ extension Expression {
320320
/// - Parameter find: The literal string substring to search for.
321321
/// - Parameter replace: The literal string substring to replace all occurrences with.
322322
/// - Returns: A new `FunctionExpr` representing the string with all occurrences replaced.
323-
func stringReplace(_ find: String, with replace: String) -> FunctionExpression{
323+
func stringReplace(_ find: String, with replace: String) -> FunctionExpression {
324324
return FunctionExpression(
325325
"string_replace",
326326
[self, Helper.sendableToExpr(find), Helper.sendableToExpr(replace)]
@@ -340,10 +340,9 @@ extension Expression {
340340
/// - Parameter replace: An `Expression` (evaluating to a string) for the substring to replace all
341341
/// occurrences with.
342342
/// - Returns: A new `FunctionExpression` representing the string with all occurrences replaced.
343-
func stringReplace(_ find: Expression, with replace: Expression) -> FunctionExpression{
343+
func stringReplace(_ find: Expression, with replace: Expression) -> FunctionExpression {
344344
return FunctionExpression("string_replace", [self, find, replace])
345345
}
346-
347346
}
348347

349348
public extension Expression {

Firestore/Swift/Source/SwiftAPI/Pipeline/Pipeline.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,8 @@ public struct Pipeline: @unchecked Sendable {
8787
self.db = db
8888
bridge = PipelineBridge(stages: stages.map { $0.bridge }, db: db)
8989
}
90-
91-
public struct Snapshot: Sendable {
92-
/// The Pipeline on which `execute()` was called to obtain this `Pipeline.Snapshot`.
93-
public let pipeline: Pipeline
9490

91+
public struct Snapshot: Sendable {
9592
/// An array of all the results in the `Pipeline.Snapshot`.
9693
public let results: [PipelineResult]
9794

@@ -100,9 +97,8 @@ public struct Pipeline: @unchecked Sendable {
10097

10198
let bridge: __PipelineSnapshotBridge
10299

103-
init(_ bridge: __PipelineSnapshotBridge, pipeline: Pipeline) {
100+
init(_ bridge: __PipelineSnapshotBridge) {
104101
self.bridge = bridge
105-
self.pipeline = pipeline
106102
executionTime = self.bridge.execution_time
107103
results = self.bridge.results.map { PipelineResult($0) }
108104
}
@@ -133,7 +129,7 @@ public struct Pipeline: @unchecked Sendable {
133129
if let error {
134130
continuation.resume(throwing: error)
135131
} else {
136-
continuation.resume(returning: Pipeline.Snapshot(result!, pipeline: self))
132+
continuation.resume(returning: Pipeline.Snapshot(result!))
137133
}
138134
}
139135
}

Firestore/Swift/Source/SwiftAPI/Pipeline/RealtimePipeline.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,8 @@ struct RealtimePipeline: @unchecked Sendable {
7979
self.db = db
8080
bridge = RealtimePipelineBridge(stages: stages.map { $0.bridge }, db: db)
8181
}
82-
83-
struct Snapshot: Sendable {
84-
/// The Pipeline on which `execute()` was called to obtain this `Pipeline.Snapshot`.
85-
public let pipeline: RealtimePipeline
8682

83+
struct Snapshot: Sendable {
8784
/// An array of all the results in the `Pipeline.Snapshot`.
8885
let results_cache: [PipelineResult]
8986

@@ -94,10 +91,8 @@ struct RealtimePipeline: @unchecked Sendable {
9491
private var options: PipelineListenOptions
9592

9693
init(_ bridge: __RealtimePipelineSnapshotBridge,
97-
pipeline: RealtimePipeline,
9894
options: PipelineListenOptions) {
9995
self.bridge = bridge
100-
self.pipeline = pipeline
10196
self.options = options
10297
metadata = bridge.metadata
10398
results_cache = self.bridge.results
@@ -118,7 +113,6 @@ struct RealtimePipeline: @unchecked Sendable {
118113
listener(
119114
RealtimePipeline.Snapshot(
120115
snapshotBridge!,
121-
pipeline: self,
122116
options: options
123117
),
124118
error

Firestore/Swift/Tests/Integration/PipelineTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1988,7 +1988,7 @@ class PipelineIntegrationTests: FSTIntegrationTestCase {
19881988

19891989
TestHelper.compare(snapshot: snapshot, expected: expectedResults, enforceOrder: true)
19901990
}
1991-
1991+
19921992
func testReverseWorksOnArray() async throws {
19931993
let collRef = collectionRef(withDocuments: [
19941994
"doc1": ["tags": ["a", "b", "c"]],

0 commit comments

Comments
 (0)