Ver a proveniência

avoid unnecessary memory copy

main
wzk784533 há 4 anos
ascendente
cometimento
28602d3625
1 ficheiros alterados com 5 adições e 2 eliminações
  1. +5
    -2
      db/builder.cc

+ 5
- 2
db/builder.cc Ver ficheiro

@ -30,11 +30,14 @@ Status BuildTable(const std::string& dbname, Env* env, const Options& options,
TableBuilder* builder = new TableBuilder(options, file);
meta->smallest.DecodeFrom(iter->key());
Slice key;
for (; iter->Valid(); iter->Next()) {
Slice key = iter->key();
meta->largest.DecodeFrom(key);
key = iter->key();
builder->Add(key, iter->value());
}
if(!key.empty()) {
meta->largest.DecodeFrom(key);
}
// Finish and check for builder errors
s = builder->Finish();

Carregando…
Cancelar
Guardar