Browse Source

clear useless code

baseline
ArcueidType 2 weeks ago
parent
commit
3a042c5b30
3 changed files with 1 additions and 13 deletions
  1. +1
    -1
      db/db_impl.cc
  2. +0
    -10
      db/fields.cc
  3. +0
    -2
      db/fields.h

+ 1
- 1
db/db_impl.cc View File

@ -1222,7 +1222,7 @@ std::vector DBImpl::FindKeysByField(Field &field) {
std::string key = iter->key().ToString();
Fields fields = iter->fields();
if (fields.find(field.first) == field.second) {
if (fields[field.first] == field.second) {
keys.emplace_back(key);
}
iter->Next();

+ 0
- 10
db/fields.cc View File

@ -69,14 +69,4 @@ namespace leveldb {
return field_array;
}
std::string Fields::find(const std::string& field_name) const {
auto it = this->_fields.find(field_name);
if (it == this->_fields.end()) {
return "";
}
return it->second;
}
} // namespace leveldb

+ 0
- 2
db/fields.h View File

@ -33,8 +33,6 @@ namespace leveldb {
// Fields编码为存入LevelDB的Value
std::string Serialize() const;
// field_name得到相应的字段值
std::string find(const std::string& field_name) const;
private:
std::map<std::string, std::string> _fields;
};

Loading…
Cancel
Save