We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1505025 commit da775ecCopy full SHA for da775ec
src/actions/transformations/replace_nulls.cc
@@ -23,21 +23,16 @@ ReplaceNulls::ReplaceNulls(const std::string &action)
23
this->action_kind = 1;
24
}
25
26
-bool ReplaceNulls::transform(std::string &val, const Transaction *trans) const {
27
- int64_t i;
28
- std::string value(val);
29
-
30
- i = 0;
31
- while (i < value.size()) {
32
- if (value.at(i) == '\0') {
33
- value[i] = ' ';
34
- } else {
35
- i++;
+bool ReplaceNulls::transform(std::string &value, const Transaction *trans) const {
+ bool changed = false;
+
+ for(auto &c : value) {
+ if (c == '\0') {
+ c = ' ';
+ changed = true;
36
37
38
39
- const auto changed = val != value;
40
- val = value;
41
return changed;
42
43
0 commit comments