Skip to content

Commit a2929a2

Browse files
committed
Make CSerAction's ForRead() constexpr
The CSerAction's ForRead() method does not depend on any runtime data, so guarantee that requests to it can be optimized out by making it constexpr. Suggested by Cory Fields.
1 parent a603925 commit a2929a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/serialize.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -773,11 +773,11 @@ void Unserialize(Stream& is, std::set<K, Pred, A>& m)
773773
*/
774774
struct CSerActionSerialize
775775
{
776-
bool ForRead() const { return false; }
776+
constexpr bool ForRead() const { return false; }
777777
};
778778
struct CSerActionUnserialize
779779
{
780-
bool ForRead() const { return true; }
780+
constexpr bool ForRead() const { return true; }
781781
};
782782

783783
template<typename Stream, typename T>

0 commit comments

Comments
 (0)