Page MenuHomePhabricator

refactor: RPC: pass named argument value as string_view
ClosedPublic

Authored by Fabien on Wed, Jun 5, 20:39.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABC35b0f01b7a4b: refactor: RPC: pass named argument value as string_view
Summary
Main purpose of this PR is to minimize copying (potentially large) RPC named arguments when calling .substr() by using std::string_view instead of std::string. Furthermore, cleans up the code by removing unnecessary complexity in ParseNonRFCJSONValue() (done first to avoid refactoring required to concatenate string and string_view), updates some naming and adds a few test cases. Should not introduce any behaviour change.

Backport of core#26612.

Depends on D16290 and D16291.

Test Plan
ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable