forked from TrueCloudLab/frostfs-s3-gw
[#458] *: Refactor working with NeoFS identities
Pull latest changes from NeoFS SDK Go library. Decrease redundant and unsafe usage of ID pointers. Use `EncodeToString` method in order to calculate protocol strings. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
3f0dbcc995
commit
087d500c5f
34 changed files with 259 additions and 280 deletions
|
@ -271,10 +271,11 @@ func (v *objectVersions) getDelHeader() string {
|
|||
return strings.Join(v.delList, ",")
|
||||
}
|
||||
|
||||
func (v *objectVersions) getVersion(oid *oid.ID) *data.ObjectInfo {
|
||||
func (v *objectVersions) getVersion(obj oid.ID) *data.ObjectInfo {
|
||||
strObj := obj.EncodeToString()
|
||||
for _, version := range v.objects {
|
||||
if version.Version() == oid.String() {
|
||||
if contains(v.delList, oid.String()) {
|
||||
if version.Version() == strObj {
|
||||
if contains(v.delList, strObj) {
|
||||
return nil
|
||||
}
|
||||
return version
|
||||
|
@ -397,7 +398,7 @@ func (n *layer) checkVersionsExist(ctx context.Context, bkt *data.BucketInfo, ob
|
|||
if err = id.DecodeString(obj.VersionID); err != nil {
|
||||
return nil, errors.GetAPIError(errors.ErrInvalidVersion)
|
||||
}
|
||||
version = versions.getVersion(&id)
|
||||
version = versions.getVersion(id)
|
||||
}
|
||||
|
||||
if version == nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue