Merge bitcoin/bitcoin#32884: rest: replace rf_names[0].rf by RESTResponseFormat::UNDEF

6d19815cd44031ff2b45fc9532f579cd81c62749 rest: replace `rf_names[0].rf` by `RESTResponseFormat::UNDEF` for code clarity (Eval EXEC)

Pull request description:

  I'm reviewing the bitcoin's rest.cpp source code.
  In the function: `ParseDataFormat`, `rf_names[0].rf` is actualy `RESTResponseFormat::UNDEF`:
  e3f416dbf7/src/rest.cpp (L48-L57)
  so it would be more clarity and code readability to use `return RESTResponseFormat::UNDEF;` to replace `return rf_names[0].rf;`

ACKs for top commit:
  maflcko:
    lgtm ACK 6d19815cd44031ff2b45fc9532f579cd81c62749
  brunoerg:
    code review ACK 6d19815cd44031ff2b45fc9532f579cd81c62749

Tree-SHA512: 420454f1cc09db44c1d76423d8623a0b8865d41d6c34015844ff83d78a9373e3e26f3f62818d1502b33eb063caf904750e858b74ddecd76750577ae82b64b0c1
This commit is contained in:
merge-script 2025-07-08 15:59:30 +01:00
commit b7e9dc8e46
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1

View File

@ -144,7 +144,7 @@ RESTResponseFormat ParseDataFormat(std::string& param, const std::string& strReq
// No format string is found
if (pos_format == std::string::npos) {
return rf_names[0].rf;
return RESTResponseFormat::UNDEF;
}
// Match format string to available formats
@ -157,7 +157,7 @@ RESTResponseFormat ParseDataFormat(std::string& param, const std::string& strReq
}
// If no suffix is found, return RESTResponseFormat::UNDEF and original string without query string
return rf_names[0].rf;
return RESTResponseFormat::UNDEF;
}
static std::string AvailableDataFormatsString()