We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d46fb1 commit 0eccd65Copy full SHA for 0eccd65
storage/rocksdb/ha_rocksdb.cc
@@ -4249,14 +4249,15 @@ class Rdb_transaction {
4249
}
4250
4251
void set_auto_incr(const GL_INDEX_ID &gl_index_id, ulonglong curr_id) {
4252
- m_auto_incr_map[gl_index_id] =
4253
- std::max(m_auto_incr_map[gl_index_id], curr_id);
+ auto &existing = m_auto_incr_map[gl_index_id];
+ existing = std::max(existing, curr_id);
4254
4255
4256
#ifndef NDEBUG
4257
ulonglong get_auto_incr(const GL_INDEX_ID &gl_index_id) {
4258
- if (m_auto_incr_map.count(gl_index_id) > 0) {
4259
- return m_auto_incr_map[gl_index_id];
+ auto iter = m_auto_incr_map.find(gl_index_id);
+ if (m_auto_incr_map.end() != iter) {
4260
+ return iter->second;
4261
4262
return 0;
4263
0 commit comments