File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change 3
3
4
4
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5
5
6
+ #include < algorithm>
6
7
#include < cstdlib>
8
+ #include < ranges>
7
9
#include " node_options.h"
8
10
#include " util.h"
9
11
@@ -393,15 +395,16 @@ void OptionsParser<Options>::Parse(
393
395
// Implications for negated options are defined with "--no-".
394
396
implied_name.insert (2 , " no-" );
395
397
}
396
- auto implications = implications_.equal_range (implied_name);
397
- for (auto imp = implications.first ; imp != implications.second ; ++imp) {
398
- if (imp->second .type == kV8Option ) {
399
- v8_args->push_back (imp->second .name );
400
- } else {
401
- *imp->second .target_field ->template Lookup <bool >(options) =
402
- imp->second .target_value ;
403
- }
404
- }
398
+ auto [f, l] = implications_.equal_range (implied_name);
399
+ std::ranges::for_each (std::ranges::subrange (f, l) | std::views::values,
400
+ [&](const auto & value) {
401
+ if (value.type == kV8Option ) {
402
+ v8_args->push_back (value.name );
403
+ } else {
404
+ *value.target_field ->template Lookup <bool >(
405
+ options) = value.target_value ;
406
+ }
407
+ });
405
408
}
406
409
407
410
if (it == options_.end ()) {
You can’t perform that action at this time.
0 commit comments