[Groonga-commit] groonga/grnxx at ecc2dfe [new_data_types] Fix a bug that BITWISE_OR/XOR return wrong results. (#106)

Back to archive index

susumu.yata null+****@clear*****
Thu Nov 13 23:19:27 JST 2014


susumu.yata	2014-11-13 23:19:27 +0900 (Thu, 13 Nov 2014)

  New Revision: ecc2dfefac7fa9d5a361ad87ede1a39c2404c62f
  https://github.com/groonga/grnxx/commit/ecc2dfefac7fa9d5a361ad87ede1a39c2404c62f

  Message:
    Fix a bug that BITWISE_OR/XOR return wrong results. (#106)

  Modified files:
    lib/grnxx/impl/expression.cpp

  Modified: lib/grnxx/impl/expression.cpp (+3 -3)
===================================================================
--- lib/grnxx/impl/expression.cpp    2014-11-13 22:57:57 +0900 (9b1bc9a)
+++ lib/grnxx/impl/expression.cpp    2014-11-13 23:19:27 +0900 (914dd42)
@@ -1060,7 +1060,7 @@ void BitwiseBinaryNode<T, U>::evaluate(ArrayCRef<Record> records,
   this->fill_arg1_values(records);
   this->fill_arg2_values(records);
   for (size_t i = 0; i < records.size(); ++i) {
-    results[i] = this->arg1_values_[i] & this->arg2_values_[i];
+    results[i] = operator_(this->arg1_values_[i], this->arg2_values_[i]);
   }
 }
 
@@ -1091,7 +1091,7 @@ void BitwiseBinaryNode<T, Bool>::filter(ArrayCRef<Record> input_records,
   this->fill_arg2_values(input_records);
   size_t count = 0;
   for (size_t i = 0; i < input_records.size(); ++i) {
-    if ((this->arg1_values_[i] & this->arg2_values_[i]).is_true()) {
+    if (operator_(this->arg1_values_[i], this->arg2_values_[i]).is_true()) {
       (*output_records)[count] = input_records[i];
       ++count;
     }
@@ -1107,7 +1107,7 @@ void BitwiseBinaryNode<T, Bool>::evaluate(ArrayCRef<Record> records,
   // TODO: Should be processed per 64 bits.
   //       Check the 64-bit boundary and do it!
   for (size_t i = 0; i < records.size(); ++i) {
-    results[i] = this->arg1_values_[i] & this->arg2_values_[i];
+    results[i] = operator_(this->arg1_values_[i], this->arg2_values_[i]);
   }
 }
 
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index