mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-20 15:27:32 +09:00
Change the MozMap API and data storage to more what we want record<> to look like
This commit is contained in:
parent
c4115c8ad5
commit
4faee1f41a
4 changed files with 55 additions and 103 deletions
|
|
@ -2293,19 +2293,13 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
static void
|
||||
TraceMozMapValue(T* aValue, void* aClosure)
|
||||
{
|
||||
JSTracer* trc = static_cast<JSTracer*>(aClosure);
|
||||
// Act like it's a one-element sequence to leverage all that infrastructure.
|
||||
SequenceTracer<T>::TraceSequence(trc, aValue, aValue + 1);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void TraceMozMap(JSTracer* trc, MozMap<T>& map)
|
||||
{
|
||||
map.EnumerateValues(TraceMozMapValue<T>, trc);
|
||||
for (auto& entry : map.Entries()) {
|
||||
// Act like it's a one-element sequence to leverage all that infrastructure.
|
||||
SequenceTracer<T>::TraceSequence(trc, &entry.mValue, &entry.mValue + 1);
|
||||
}
|
||||
}
|
||||
|
||||
// sequence<MozMap>
|
||||
|
|
@ -2317,7 +2311,7 @@ class SequenceTracer<MozMap<T>, false, false, false>
|
|||
public:
|
||||
static void TraceSequence(JSTracer* trc, MozMap<T>* seqp, MozMap<T>* end) {
|
||||
for (; seqp != end; ++seqp) {
|
||||
seqp->EnumerateValues(TraceMozMapValue<T>, trc);
|
||||
TraceMozMap(trc, *seqp);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue