Ver código fonte

fix: dont clobber

Sam Jaffe 1 ano atrás
pai
commit
4a309cd429
2 arquivos alterados com 3 adições e 2 exclusões
  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);
   }
 };
 }