Skip to content

Commit 39cce5b

Browse files
committed
Use "with" expression to update node
1 parent 92edd44 commit 39cce5b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/DocoptNet.Playground/Pages/Index.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ Options:
183183
.GroupBy(e => e.Name, e => e, (_, g) => new Node(g.First().Name, g.First().ValueKind, g.Count(), ArgValue.None))
184184
.ToList();
185185
_args = Docopt.Internal.Apply(docopt, _input, argv.AsEnumerable(), help: false, version: null, optionsFirst: _optionsFirst, exit: false)!;
186-
_nodes = _nodes.Select(n => new Node(n.Name, n.ValueKind, n.Count, _args.TryGetValue(n.Name, out var v) ? v : ArgValue.None)).ToList();
186+
_nodes = _nodes.Select(n => n with { Value = _args.TryGetValue(n.Name, out var v) ? v : ArgValue.None }).ToList();
187187
_ms = sw.Elapsed;
188188
}
189189
catch (DocoptBaseException e)

0 commit comments

Comments
 (0)