diff options
author | Alain Zscheile <zseri.devel@ytrizja.de> | 2022-05-04 07:44:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-04 07:44:32 +0200 |
commit | 1385b2007804c8a0370f2a6555045a00e34b07c7 (patch) | |
tree | 3f83e56e03bd60d6c07d0ee14e70949df04b9e0f /src/libstore/filetransfer.cc | |
parent | 9489b4b7ef73ab20e8f49213d8711ca56b59107e (diff) |
Get rid of most `.at` calls (#6393)
Use one of `get` or `getOr` instead which will either return a null-pointer (with a nicer error message) or a default value when the key is missing.
Diffstat (limited to 'src/libstore/filetransfer.cc')
-rw-r--r-- | src/libstore/filetransfer.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc index 529a41891..8454ad7d2 100644 --- a/src/libstore/filetransfer.cc +++ b/src/libstore/filetransfer.cc @@ -692,10 +692,10 @@ struct curlFileTransfer : public FileTransfer #if ENABLE_S3 auto [bucketName, key, params] = parseS3Uri(request.uri); - std::string profile = get(params, "profile").value_or(""); - std::string region = get(params, "region").value_or(Aws::Region::US_EAST_1); - std::string scheme = get(params, "scheme").value_or(""); - std::string endpoint = get(params, "endpoint").value_or(""); + std::string profile = getOr(params, "profile", ""); + std::string region = getOr(params, "region", Aws::Region::US_EAST_1); + std::string scheme = getOr(params, "scheme", ""); + std::string endpoint = getOr(params, "endpoint", ""); S3Helper s3Helper(profile, region, scheme, endpoint); |