Skip to content

Commit 5038e26

Browse files
authored
Fix string_view referring to an out-of-scope string (#2074)
1 parent 8b1efab commit 5038e26

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Firestore/Example/Firestore.xcodeproj/xcshareddata/xcschemes/Firestore_Tests_iOS.xcscheme

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
2929
enableASanStackUseAfterReturn = "YES"
30-
enableThreadSanitizer = "YES"
3130
shouldUseLaunchSchemeArgsEnv = "YES">
3231
<Testables>
3332
<TestableReference

Firestore/Example/Tests/API/FSTAPIHelpers.mm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#import <FirebaseFirestore/FIRDocumentReference.h>
2121
#import <FirebaseFirestore/FIRSnapshotMetadata.h>
2222

23+
#include <string>
24+
2325
#import "Firestore/Source/API/FIRCollectionReference+Internal.h"
2426
#import "Firestore/Source/API/FIRDocumentReference+Internal.h"
2527
#import "Firestore/Source/API/FIRDocumentSnapshot+Internal.h"
@@ -102,7 +104,7 @@
102104
hasPendingWrites ? FSTDocumentStateLocalMutations
103105
: FSTDocumentStateSynced)];
104106
if (hasPendingWrites) {
105-
const absl::string_view documentKey = util::StringFormat("%s/%s", path, key);
107+
const std::string documentKey = util::StringFormat("%s/%s", path, key);
106108
mutatedKeys = mutatedKeys.insert(testutil::Key(documentKey));
107109
}
108110
}
@@ -118,7 +120,7 @@
118120
changeWithDocument:docToAdd
119121
type:FSTDocumentViewChangeTypeAdded]];
120122
if (hasPendingWrites) {
121-
const absl::string_view documentKey = util::StringFormat("%s/%s", path, key);
123+
const std::string documentKey = util::StringFormat("%s/%s", path, key);
122124
mutatedKeys = mutatedKeys.insert(testutil::Key(documentKey));
123125
}
124126
}

0 commit comments

Comments
 (0)