fix: resolve concurrent read/write issues in WrapObjName (#7865)

This commit is contained in:
foxxorcat 2025-01-27 20:06:18 +08:00 committed by GitHub
parent c2633dd443
commit bdcf450203
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 5 deletions

View File

@ -115,12 +115,12 @@ func ExtractFolder(objs []Obj, extractFolder string) {
}
func WrapObjName(objs Obj) Obj {
return &ObjWrapName{Obj: objs}
return &ObjWrapName{Name: utils.MappingName(objs.GetName()), Obj: objs}
}
func WrapObjsName(objs []Obj) {
for i := 0; i < len(objs); i++ {
objs[i] = &ObjWrapName{Obj: objs[i]}
objs[i] = &ObjWrapName{Name: utils.MappingName(objs[i].GetName()), Obj: objs[i]}
}
}

View File

@ -16,9 +16,6 @@ func (o *ObjWrapName) Unwrap() Obj {
}
func (o *ObjWrapName) GetName() string {
if o.Name == "" {
o.Name = utils.MappingName(o.Obj.GetName())
}
return o.Name
}