Skip to content

Commit

Permalink
move ObjectMap::empty() into header and make noexcept
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffthemedio committed Aug 2, 2022
1 parent 20dd2ed commit 59d485c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions universe/ObjectMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,6 @@ ObjectMap* ObjectMap::Clone(const Universe& universe, int empire_id) const {
return result.release();
}

bool ObjectMap::empty() const
{ return m_objects.empty(); }

int ObjectMap::HighestObjectID() const {
if (m_objects.empty())
return INVALID_OBJECT_ID;
Expand Down
2 changes: 1 addition & 1 deletion universe/ObjectMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class FO_COMMON_API ObjectMap {
[[nodiscard]] std::size_t size() const;

/** Returns true if this ObjectMap contains no objects */
[[nodiscard]] bool empty() const;
[[nodiscard]] bool empty() const noexcept { return m_objects.empty(); };

/** Returns a pointer to the object of type T with ID number \a id.
* Returns a null std::shared_ptr if none exists or the object with
Expand Down

0 comments on commit 59d485c

Please sign in to comment.