Skip to content

Commit

Permalink
Fix 'first' and 'last' return for Lopmap
Browse files Browse the repository at this point in the history
  • Loading branch information
oblivioncth committed Dec 27, 2024
1 parent 8625559 commit 0e73f6e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/core/include/qx/core/qx-lopmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,11 @@ class Lopmap
return std::make_pair<const_iterator, const_iterator>(sItrPair.first, sItrPair.second);
}

const T& first() const { Q_ASSERT(!mStorage.empty()); mStorage.cbegin()->value; }
const Key& firstKey() const { Q_ASSERT(!mStorage.empty()); *mStorage.cbegin()->keyPtr; }
const T& first() const { Q_ASSERT(!mStorage.empty()); return mStorage.cbegin()->value; }
const Key& firstKey() const { Q_ASSERT(!mStorage.empty()); return *mStorage.cbegin()->keyPtr; }

const T& last() const { Q_ASSERT(!mStorage.empty()); mStorage.cend()->value; }
const Key& lastKey() const { Q_ASSERT(!mStorage.empty()); *mStorage.cend()->keyPtr; }
const T& last() const { Q_ASSERT(!mStorage.empty()); return mStorage.cend()->value; }
const Key& lastKey() const { Q_ASSERT(!mStorage.empty()); return *mStorage.cend()->keyPtr; }

Key key(const T& value, const Key& defaultKey = Key()) const
{
Expand Down

0 comments on commit 0e73f6e

Please sign in to comment.