diff options
author | Jack Lloyd <[email protected]> | 2018-03-17 12:28:06 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-03-17 12:28:06 -0400 |
commit | 004fd08a07452c6cf45fa96071a246ec2e30fcf4 (patch) | |
tree | 3302f1dc6db549f24ba118c2ef37e309fc84f2f3 /src | |
parent | 6b7f910932edf6c0b97a25b70ccb268020975a12 (diff) |
Avoid creating stringstream unless needed in version check
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/utils/version.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/utils/version.cpp b/src/lib/utils/version.cpp index d04856d37..ccf83bf6c 100644 --- a/src/lib/utils/version.cpp +++ b/src/lib/utils/version.cpp @@ -77,16 +77,16 @@ std::string runtime_version_check(uint32_t major, uint32_t minor, uint32_t patch) { - std::ostringstream oss; - if(major != version_major() || minor != version_minor() || patch != version_patch()) { + std::ostringstream oss; oss << "Warning: linked version (" << short_version_string() << ")" << " does not match version built against " << "(" << major << '.' << minor << '.' << patch << ")\n"; + return oss.str(); } - return oss.str(); + return ""; } } |