From f780f35b06189b34a60810107324df0cb99e4824 Mon Sep 17 00:00:00 2001 From: Igor Canadi Date: Thu, 24 Jul 2014 16:45:26 -0400 Subject: [PATCH] Fix compile warning --- utilities/spatialdb/spatial_db.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utilities/spatialdb/spatial_db.cc b/utilities/spatialdb/spatial_db.cc index c928d0303..1c28e8ba6 100644 --- a/utilities/spatialdb/spatial_db.cc +++ b/utilities/spatialdb/spatial_db.cc @@ -685,12 +685,12 @@ Status SpatialDB::Open(const SpatialDBOptions& options, const std::string& name, Iterator* iter = base_db->NewIterator(ReadOptions(), handles[0]); iter->SeekToLast(); if (iter->Valid()) { - uint64_t last_id; - bool ok = GetFixed64BigEndian(iter->key(), &last_id); - if (!ok) { + uint64_t last_id = 0; + if (!GetFixed64BigEndian(iter->key(), &last_id)) { s = Status::Corruption("Invalid key in data column family"); + } else { + next_id = last_id + 1; } - next_id = last_id + 1; } else { next_id = 1; }