mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2024-12-22 16:58: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.
|
// something format error, so skip this.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
xattrs.emplace(std::move(key), std::move(val));
|
xattrs[key] = val;
|
||||||
}
|
}
|
||||||
return xattrs.size();
|
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);
|
parse_xattrs(strxattrs, xattrs);
|
||||||
|
|
||||||
// add name(do not care overwrite and empty name/value)
|
// add name(do not care overwrite and empty name/value)
|
||||||
std::string val(value, size);
|
xattrs[name] = std::string(value, size);
|
||||||
xattrs.emplace(name, std::move(val));
|
|
||||||
|
|
||||||
// build new strxattrs(not encoded) and set it to headers_t
|
// build new strxattrs(not encoded) and set it to headers_t
|
||||||
meta["x-amz-meta-xattr"] = build_xattrs(xattrs);
|
meta["x-amz-meta-xattr"] = build_xattrs(xattrs);
|
||||||
|
@ -815,6 +815,10 @@ function test_extended_attributes {
|
|||||||
touch "${TEST_TEXT_FILE}"
|
touch "${TEST_TEXT_FILE}"
|
||||||
|
|
||||||
# set value
|
# 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}"
|
set_xattr key1 value1 "${TEST_TEXT_FILE}"
|
||||||
get_xattr key1 "${TEST_TEXT_FILE}" | grep -q '^value1$'
|
get_xattr key1 "${TEST_TEXT_FILE}" | grep -q '^value1$'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user