Skip to content

Commit

Permalink
xrEngine/pure.h: optimization
Browse files Browse the repository at this point in the history
Removed unused flags
Made first Add() method to be constexpr
r-value is used now for second Add() method
  • Loading branch information
Xottab-DUTY committed May 25, 2018
1 parent d514aa9 commit b5b2b75
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/xrEngine/pure.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ struct MessageObject
{
IPure* Object;
int Prio;
u32 Flags;
};

template<class T>
Expand All @@ -57,12 +56,12 @@ class MessageRegistry

void Clear() { messages.clear(); }

void Add(T* object, const int priority = REG_PRIORITY_NORMAL, const u32 flags = 0)
constexpr void Add(T* object, const int priority = REG_PRIORITY_NORMAL)
{
Add({ object, priority, flags });
Add({ object, priority });
}

void Add(MessageObject newMessage)
void Add(MessageObject&& newMessage)
{
#ifdef DEBUG
VERIFY(newMessage.Object);
Expand Down

0 comments on commit b5b2b75

Please sign in to comment.