OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-atomspace commits / 7f5fae2

Careful with paren placement when printing bools
7f5fae2ff47b5c80ad11ab26415823a3e5ef8dd4
by Linas Vepštas <linasvepstas@gmail.com> · 2026-01-23T19:27:33.000Z

Changed files (1) +2 -6

opencog/atoms/value/BoolValue.cc +2 -6
……@@ -169,7 +169,7 @@ bool BoolValue::operator==(const Value& other) const
169169std::string BoolValue::raw_hex_string() const
170170{
171171 // Print in hexadecimal
172 std::string rv = " #x";
172 std::string rv = "#x";
173173
174174 // The native storage format used above is big endian, in that
175175 // bit zero is the left-most bit, bit one is to the right of that,
……@@ -187,7 +187,6 @@ std::string BoolValue::raw_hex_string() const
187187 snprintf(buf, sizeof(buf), "%016lx", word);
188188 rv += buf;
189189 }
190 rv += ")";
191190 return rv;
192191 }
193192
……@@ -203,10 +202,7 @@ std::string BoolValue::raw_hex_string() const
203202
204203 // Are we done yet?
205204 if (1 == word_count)
206 {
207 rv += ")";
208205 return rv;
209 }
210206
211207 // Middle words are spliced from low bits of previous
212208 // and high bits of current.
……@@ -247,7 +243,7 @@ std::string BoolValue::to_string(const std::string& indent, Type t) const
247243 }
248244 }
249245 else
250 rv += raw_hex_string();
246 rv += " " + raw_hex_string();
251247 });
252248
253249 rv += ")";