mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[IDE] Utils: Allow indexed access to DelayedStringRetriever. (#7567)
This commit is contained in:
@@ -320,11 +320,15 @@ public:
|
||||
size_t preferred_buffer_size() const override {
|
||||
return 0;
|
||||
}
|
||||
void retrieve(llvm::function_ref<void(StringRef)> F) {
|
||||
void retrieve(llvm::function_ref<void(StringRef)> F) const {
|
||||
for (auto P : StartEnds) {
|
||||
F(StringRef(OS.begin() + P.first, P.second - P.first));
|
||||
}
|
||||
}
|
||||
StringRef operator[](unsigned I) const {
|
||||
auto P = StartEnds[I];
|
||||
return StringRef(OS.begin() + P.first, P.second - P.first);
|
||||
}
|
||||
};
|
||||
} // namespace ide
|
||||
} // namespace swift
|
||||
|
||||
Reference in New Issue
Block a user