MCPcopy Index your code
hub / github.com/OpenListTeam/OpenList / UpdateObject

Method UpdateObject

internal/op/cache.go:190–204  ·  view source on GitHub ↗
(oldName string, newObj model.Obj)

Source from the content-addressed store, hash-verified

188}
189
190func (dc *directoryCache) UpdateObject(oldName string, newObj model.Obj) {
191 dc.mu.Lock()
192 defer dc.mu.Unlock()
193 if oldName != "" {
194 for i, obj := range dc.objs {
195 if obj.GetName() == oldName {
196 dc.objs[i] = newObj
197 dc.dirtyFlags |= dirtyUpdate
198 return
199 }
200 }
201 }
202 dc.objs = append(dc.objs, newObj)
203 dc.dirtyFlags |= dirtyUpdate
204}
205
206func (dc *directoryCache) GetSortedObjects(meta driver.Meta) []model.Obj {
207 dc.mu.RLock()

Callers 7

ArchiveDecompressFunction · 0.80
MakeDirFunction · 0.80
MoveFunction · 0.80
RenameFunction · 0.80
CopyFunction · 0.80
PutFunction · 0.80
PutURLFunction · 0.80

Calls 2

UnlockMethod · 0.65
GetNameMethod · 0.65

Tested by

no test coverage detected