chore(3p/nix/libexpr): Remove dead code from attribute sets
These bits are no longer required with the hashmap-backed implementation of attribute sets. Change-Id: I8b936d8d438a00bad4ccf8e0b4dd719c559ce8c2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/912 Tested-by: BuildkiteCI Reviewed-by: edef <edef@edef.eu>
This commit is contained in:
parent
ca03175e31
commit
4455f28e42
3 changed files with 2 additions and 17 deletions
2
third_party/nix/src/libexpr/attr-set.cc
vendored
2
third_party/nix/src/libexpr/attr-set.cc
vendored
|
@ -36,8 +36,6 @@ void Bindings::insert_or_assign(const Attr& attr) {
|
||||||
|
|
||||||
size_t Bindings::size() { return attributes_.size(); }
|
size_t Bindings::size() { return attributes_.size(); }
|
||||||
|
|
||||||
size_t Bindings::capacity() { return 0; }
|
|
||||||
|
|
||||||
bool Bindings::empty() { return attributes_.empty(); }
|
bool Bindings::empty() { return attributes_.empty(); }
|
||||||
|
|
||||||
std::vector<const Attr*> Bindings::lexicographicOrder() {
|
std::vector<const Attr*> Bindings::lexicographicOrder() {
|
||||||
|
|
15
third_party/nix/src/libexpr/attr-set.hh
vendored
15
third_party/nix/src/libexpr/attr-set.hh
vendored
|
@ -21,15 +21,8 @@ struct Attr {
|
||||||
Attr(Symbol name, Value* value, Pos* pos = &noPos)
|
Attr(Symbol name, Value* value, Pos* pos = &noPos)
|
||||||
: name(name), value(value), pos(pos){};
|
: name(name), value(value), pos(pos){};
|
||||||
Attr() : pos(&noPos){};
|
Attr() : pos(&noPos){};
|
||||||
bool operator<(const Attr& other) const { return name < other.name; }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: remove this, it only exists briefly while I get rid of the
|
|
||||||
// current Attr struct
|
|
||||||
inline bool operator==(const Attr& lhs, const Attr& rhs) {
|
|
||||||
return lhs.name == rhs.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Convenience alias for the backing map, with the garbage-collecting
|
// Convenience alias for the backing map, with the garbage-collecting
|
||||||
// allocator explicitly specified.
|
// allocator explicitly specified.
|
||||||
using AttributeMap =
|
using AttributeMap =
|
||||||
|
@ -63,15 +56,9 @@ class Bindings {
|
||||||
iterator begin();
|
iterator begin();
|
||||||
iterator end();
|
iterator end();
|
||||||
|
|
||||||
// Merge values from other into the current attribute
|
// Merge values from other into this attribute set.
|
||||||
void merge(const Bindings& other);
|
void merge(const Bindings& other);
|
||||||
|
|
||||||
// ???
|
|
||||||
[[deprecated]] size_t capacity();
|
|
||||||
|
|
||||||
// oh no
|
|
||||||
// Attr& operator[](size_t pos); // { return attrs[pos]; }
|
|
||||||
|
|
||||||
// TODO: can callers just iterate?
|
// TODO: can callers just iterate?
|
||||||
[[deprecated]] std::vector<const Attr*> lexicographicOrder();
|
[[deprecated]] std::vector<const Attr*> lexicographicOrder();
|
||||||
|
|
||||||
|
|
2
third_party/nix/src/libexpr/eval.cc
vendored
2
third_party/nix/src/libexpr/eval.cc
vendored
|
@ -1865,7 +1865,7 @@ size_t valueSize(Value& v) {
|
||||||
case tAttrs:
|
case tAttrs:
|
||||||
if (seen.find(v.attrs) == seen.end()) {
|
if (seen.find(v.attrs) == seen.end()) {
|
||||||
seen.insert(v.attrs);
|
seen.insert(v.attrs);
|
||||||
sz += sizeof(Bindings) + sizeof(Attr) * v.attrs->capacity();
|
sz += sizeof(Bindings);
|
||||||
for (auto& i : *v.attrs) {
|
for (auto& i : *v.attrs) {
|
||||||
sz += doValue(*i.second.value);
|
sz += doValue(*i.second.value);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue