Skip to content

Commit c3f616b

Browse files
authored
Use .at() method instead of operator[] for shareable worklet lookup (#604)
1 parent 35d684e commit c3f616b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

cpp/MarkdownGlobal.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ void unregisterMarkdownWorklet(const int parserId) {
3636

3737
std::shared_ptr<ShareableWorklet> getMarkdownWorklet(const int parserId) {
3838
std::unique_lock<std::mutex> lock(globalMarkdownShareableWorkletsMutex);
39-
const auto &worklet = globalMarkdownShareableWorklets[parserId];
40-
assert(worklet != nullptr);
41-
return worklet;
39+
return globalMarkdownShareableWorklets.at(parserId);
4240
}
4341

4442
} // namespace livemarkdown

0 commit comments

Comments
 (0)