Browse Source

remove UsrRef

pull/2/head
Jacob Dufault 8 years ago
parent
commit
5ebf4551b1
  1. 2
      src/cache.h
  2. 17
      src/command_line.cc
  3. 15
      src/query.h
  4. 2
      src/utils.h

2
src/cache.h

@ -3,7 +3,7 @@
#include <memory>
#include <string>
class IndexedFile;
struct IndexedFile;
std::string GetCachedFileName(std::string source_file);

17
src/command_line.cc

@ -351,23 +351,6 @@ void AddCodeLens(
result->push_back(code_lens);
}
// TODO: clean these overrides up...
void AddCodeLens(
QueryableDatabase* db,
std::vector<TCodeLens>* result,
QueryableLocation loc,
const std::vector<UsrRef>& uses,
bool exclude_loc,
bool only_interesting,
const char* singular,
const char* plural) {
std::vector<QueryableLocation> uses0;
uses0.reserve(uses.size());
for (const UsrRef& use : uses)
uses0.push_back(use.loc);
AddCodeLens(db, result, loc, uses0, exclude_loc, only_interesting, singular, plural);
}
void AddCodeLens(
QueryableDatabase* db,
std::vector<TCodeLens>* result,

15
src/query.h

@ -103,21 +103,6 @@ struct QueryFuncRef {
}
};
struct UsrRef {
Usr usr;
QueryableLocation loc;
UsrRef(Usr usr, QueryableLocation loc) : usr(usr), loc(loc) {}
bool operator==(const UsrRef& other) const {
return usr == other.usr && loc.range.start == other.loc.range.start;
}
bool operator!=(const UsrRef& other) const { return !(*this == other); }
bool operator<(const UsrRef& other) const {
return usr < other.usr && loc.range.start < other.loc.range.start;
}
};
// There are two sources of reindex updates: the (single) definition of a
// symbol has changed, or one of many users of the symbol has changed.
//

2
src/utils.h

@ -3,7 +3,7 @@
#include <functional>
#include <memory>
#include <string>
#include <unordered_map>>
#include <unordered_map>
#include <vector>
// Returns true if |value| starts/ends with |start| or |ending|.

Loading…
Cancel
Save