Browse Source

fix: dont clobber

Sam Jaffe 1 năm trước cách đây
mục cha
commit
4a309cd429
2 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 1 0
      Makefile
  2. 2 2
      include/jvalidate/validation_result.h

+ 1 - 0
Makefile

@@ -1,3 +1,4 @@
+SHELL=/bin/bash -o pipefail
 INTERACTIVE:=$(shell [ -t 0 ] && echo 1)
 
 ifdef INTERACTIVE

+ 2 - 2
include/jvalidate/validation_result.h

@@ -54,14 +54,14 @@ private:
   void annotate(ValidationResult && result) {
     for (auto const & [where, errors] : result.annotations_) {
       for (auto const & [schema_path, message] : errors) {
-        annotations_[where][schema_path] += message;
+        annotations_[where].emplace(schema_path, message);
       }
     }
   }
 
   void annotate(detail::Pointer const & where, detail::Pointer const & schema_path,
                 std::string const & message) {
-    annotations_[where][schema_path] += message;
+    annotations_[where].emplace(schema_path, message);
   }
 };
 }