Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions include/container/seadStrTreeMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class StrTreeMap : public TreeMapImpl<SafeString>

bool isEmpty() const { return mSize == 0; }

bool replace(const SafeString& key, const Value& value);
Value* insert(const SafeString& key, const Value& value);
void clear();

Expand Down Expand Up @@ -126,6 +127,17 @@ inline void StrTreeMap<N, Value>::freeBuffer()
mFreeList.reset();
}

template <s32 N, typename Value>
inline bool StrTreeMap<N, Value>::replace(const SafeString& key, const Value& value)
{
Node* node = find(key);
if (!node)
return false;

node->value() = value;
return true;
}

template <s32 N, typename Value>
inline Value* StrTreeMap<N, Value>::insert(const SafeString& key, const Value& value)
{
Expand Down
Loading