mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-12-22 08:48:55 +00:00
Reverted to direct array access instead of std::map emplace
This commit is contained in:
parent
7e94b64ae7
commit
6781ef5bd1
@ -3739,7 +3739,7 @@ static size_t parse_xattrs(const std::string& strxattrs, xattrs_t& xattrs)
|
||||
// something format error, so skip this.
|
||||
continue;
|
||||
}
|
||||
xattrs.emplace(std::move(key), std::move(val));
|
||||
xattrs[key] = val;
|
||||
}
|
||||
return xattrs.size();
|
||||
}
|
||||
@ -3805,8 +3805,7 @@ static int set_xattrs_to_header(headers_t& meta, const char* name, const char* v
|
||||
parse_xattrs(strxattrs, xattrs);
|
||||
|
||||
// add name(do not care overwrite and empty name/value)
|
||||
std::string val(value, size);
|
||||
xattrs.emplace(name, std::move(val));
|
||||
xattrs[name] = std::string(value, size);
|
||||
|
||||
// build new strxattrs(not encoded) and set it to headers_t
|
||||
meta["x-amz-meta-xattr"] = build_xattrs(xattrs);
|
||||
|
@ -815,6 +815,10 @@ function test_extended_attributes {
|
||||
touch "${TEST_TEXT_FILE}"
|
||||
|
||||
# set value
|
||||
set_xattr key1 value0 "${TEST_TEXT_FILE}"
|
||||
get_xattr key1 "${TEST_TEXT_FILE}" | grep -q '^value0$'
|
||||
|
||||
# over write value
|
||||
set_xattr key1 value1 "${TEST_TEXT_FILE}"
|
||||
get_xattr key1 "${TEST_TEXT_FILE}" | grep -q '^value1$'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user