Skip to content

Commit c70df43

Browse files
committed
[fix] Fix performance bugs
1 parent 6408e41 commit c70df43

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

include/klee/ADT/SparseStorage.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ class SparseStorage {
6666
}
6767

6868
ValueType load(size_t idx) const {
69-
return contains(idx) ? internalStorage.at(idx) : defaultValue;
69+
auto it = internalStorage.find(idx);
70+
return it != internalStorage.end() ? it->second : defaultValue;
7071
}
7172

7273
size_t sizeOfSetRange() const {

lib/Core/Memory.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@ const UpdateList &ObjectState::getUpdates() const {
138138
void ObjectState::flushForRead() const {
139139
for (const auto &unflushed : unflushedMask.storage()) {
140140
auto offset = unflushed.first;
141-
assert(knownSymbolics.load(offset));
142-
updates.extend(ConstantExpr::create(offset, Expr::Int32),
143-
knownSymbolics.load(offset));
141+
auto value = knownSymbolics.load(offset);
142+
assert(value);
143+
updates.extend(ConstantExpr::create(offset, Expr::Int32), value);
144144
}
145145
unflushedMask.reset(false);
146146
}

0 commit comments

Comments
 (0)