Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e42555e

Browse files
Make code of stamp_arithm's ExtractStr more readable and sensible
1 parent 81c61c3 commit e42555e

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

blobstamper/stamp_arithm.h

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/******************************************************************************
22
*
3-
* Copyright 2021 Nikolay Shaplov (Postgres Professional)
3+
* Copyright 2021-2023 Nikolay Shaplov (Postgres Professional)
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
66
* you may not use this file except in compliance with the License.
@@ -34,15 +34,8 @@ template<class T> class StampArithm: public StampFixed, public StampBaseStr, pub
3434
template<class T> std::string
3535
StampArithm<T>::ExtractStr(Blob &blob)
3636
{
37-
std::string res;
38-
std::vector<char> v = this->ExtractBin(blob);
39-
40-
if (v.size() == 0)
41-
return "";
42-
43-
T *pT = (T *) &v[0];
44-
45-
return to_string_precise(*pT);
37+
T value = this->ExtractValue(blob);
38+
return to_string_precise(value);
4639
}
4740

4841
template<class T> T

0 commit comments

Comments
 (0)