File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -87,13 +87,14 @@ class Reader {
8787 }
8888 }
8989
90- rfl::Result<InputArrayType> to_array (InputVarType _var) const noexcept ;
90+ rfl::Result<InputArrayType> to_array (const InputVarType& _var) const noexcept ;
9191
92- rfl::Result<InputObjectType> to_object (InputVarType _var) const noexcept ;
92+ rfl::Result<InputObjectType> to_object (
93+ const InputVarType& _var) const noexcept ;
9394
9495 template <class ArrayReader >
95- std::optional<Error> read_array (ArrayReader _array_reader,
96- InputArrayType _arr) const noexcept {
96+ std::optional<Error> read_array (const ArrayReader& _array_reader,
97+ const InputArrayType& _arr) const noexcept {
9798 for (auto & val : _arr.val_ ->array_range ()) {
9899 const auto err = _array_reader.read (InputVarType{&val});
99100 if (err) {
@@ -105,7 +106,7 @@ class Reader {
105106
106107 template <class ObjectReader >
107108 std::optional<Error> read_object (const ObjectReader& _object_reader,
108- InputObjectType _obj) const noexcept {
109+ const InputObjectType& _obj) const noexcept {
109110 for (auto & kv : _obj.val_ ->object_range ()) {
110111 _object_reader.read (kv.key (), InputVarType{&kv.value ()});
111112 }
Original file line number Diff line number Diff line change @@ -25,15 +25,15 @@ bool Reader::is_empty(const InputVarType& _var) const noexcept {
2525}
2626
2727rfl::Result<Reader::InputArrayType> Reader::to_array (
28- InputVarType _var) const noexcept {
28+ const InputVarType& _var) const noexcept {
2929 if (!_var.val_ ->is_array ()) {
3030 return Error (" Could not cast to an array." );
3131 }
3232 return InputArrayType{_var.val_ };
3333}
3434
3535rfl::Result<Reader::InputObjectType> Reader::to_object (
36- InputVarType _var) const noexcept {
36+ const InputVarType& _var) const noexcept {
3737 if (!_var.val_ ->is_object ()) {
3838 return Error (" Could not cast to an object." );
3939 }
You can’t perform that action at this time.
0 commit comments