| 262 | } |
| 263 | |
| 264 | bool NodeDefBuilder::AttrValueAlreadyPresent(StringPiece name, |
| 265 | const AttrValue& value) { |
| 266 | if (const AttrValue* found = AttrSlice(node_def_).Find(name)) { |
| 267 | if (!AreAttrValuesEqual(*found, value)) { |
| 268 | errors_.push_back(strings::StrCat("Inconsistent values for attr '", name, |
| 269 | "' ", SummarizeAttrValue(*found), |
| 270 | " vs. ", SummarizeAttrValue(value))); |
| 271 | } |
| 272 | return true; |
| 273 | } |
| 274 | return false; |
| 275 | } |
| 276 | |
| 277 | NodeDefBuilder& NodeDefBuilder::Attr(StringPiece name, const AttrValue& value) { |
| 278 | if (!AttrValueAlreadyPresent(name, value)) { |
nothing calls this directly
no test coverage detected