|
14 | 14 | namespace { |
15 | 15 |
|
16 | 16 | struct ProcessedRuleHasher { |
17 | | - auto |
18 | | - operator()(const std::tuple<const sourcemeta::core::JSON *, std::string_view, |
19 | | - std::uint64_t> &value) const noexcept |
| 17 | + auto operator()(const std::tuple<sourcemeta::core::Pointer, std::string_view, |
| 18 | + std::uint64_t> &value) const noexcept |
20 | 19 | -> std::size_t { |
21 | | - return std::hash<const void *>{}(std::get<0>(value)) ^ |
| 20 | + return sourcemeta::core::Pointer::Hasher{}(std::get<0>(value)) ^ |
22 | 21 | (std::hash<std::string_view>{}(std::get<1>(value)) << 1) ^ |
23 | 22 | (std::hash<std::uint64_t>{}(std::get<2>(value)) << 2); |
24 | 23 | } |
@@ -198,9 +197,8 @@ auto SchemaTransformer::apply(core::JSON &schema, |
198 | 197 | const core::JSON::String &exclude_keyword) const |
199 | 198 | -> std::pair<bool, std::uint8_t> { |
200 | 199 | assert(!this->rules.empty()); |
201 | | - std::unordered_set< |
202 | | - std::tuple<const core::JSON *, std::string_view, std::uint64_t>, |
203 | | - ProcessedRuleHasher> |
| 200 | + std::unordered_set<std::tuple<core::Pointer, std::string_view, std::uint64_t>, |
| 201 | + ProcessedRuleHasher> |
204 | 202 | processed_rules; |
205 | 203 |
|
206 | 204 | core::SchemaFrame frame{core::SchemaFrame::Mode::References}; |
@@ -285,8 +283,8 @@ auto SchemaTransformer::apply(core::JSON &schema, |
285 | 283 | analyse_frame(frame, schema, walker, resolver, default_dialect, |
286 | 284 | default_id); |
287 | 285 | } else if (current.is_boolean()) { |
288 | | - std::tuple<const core::JSON *, std::string_view, std::uint64_t> mark{ |
289 | | - ¤t, rule->name(), current.fast_hash()}; |
| 286 | + std::tuple<core::Pointer, std::string_view, std::uint64_t> mark{ |
| 287 | + entry_pointer, rule->name(), current.fast_hash()}; |
290 | 288 | if (processed_rules.contains(mark)) { |
291 | 289 | throw SchemaTransformRuleProcessedTwiceError(rule->name(), |
292 | 290 | entry_pointer); |
@@ -343,8 +341,8 @@ auto SchemaTransformer::apply(core::JSON &schema, |
343 | 341 | references_fixed = true; |
344 | 342 | } |
345 | 343 |
|
346 | | - std::tuple<const core::JSON *, std::string_view, std::uint64_t> mark{ |
347 | | - ¤t, rule->name(), current.fast_hash()}; |
| 344 | + std::tuple<core::Pointer, std::string_view, std::uint64_t> mark{ |
| 345 | + entry_pointer, rule->name(), current.fast_hash()}; |
348 | 346 | if (processed_rules.contains(mark)) { |
349 | 347 | throw SchemaTransformRuleProcessedTwiceError(rule->name(), |
350 | 348 | entry_pointer); |
|
0 commit comments