Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for sortByModTime (0.12 sec)

  1. cmd/xl-storage-format-v2.go

    			}
    			dds = append(dds, obj.ObjectV1.DataDir)
    		}
    	}
    	return dds, nil
    }
    
    // sortByModTime will sort versions by modtime in descending order,
    // meaning index 0 will be latest version.
    func (x *xlMetaV2) sortByModTime() {
    	// Quick check
    	if len(x.versions) <= 1 || sort.SliceIsSorted(x.versions, func(i, j int) bool {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Oct 22 15:30:50 UTC 2024
    - 64K bytes
    - Viewed (1)
  2. cmd/metacache-entries_test.go

    					Signature: [4]byte{2, 1, 1, 1},
    					Type:      ObjectType,
    					Flags:     0,
    				}},
    			},
    		},
    	}
    	inputSerialized := make([]metaCacheEntry, len(inputs))
    	for i, xl := range inputs {
    		xl.sortByModTime()
    		var err error
    		entry := metaCacheEntry{
    			name: "testobject",
    		}
    		entry.metadata, err = xl.AppendTo(nil)
    		if err != nil {
    			t.Fatal(err)
    		}
    		inputSerialized[i] = entry
    	}
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sun Jan 02 17:15:06 UTC 2022
    - 31.6K bytes
    - Viewed (0)
  3. cmd/xl-storage-format-v2_test.go

    	if err != nil {
    		t.Fatal(err)
    	}
    	test := func(t *testing.T, xl *xlMetaV2) {
    		if len(xl.versions) != 855 {
    			t.Errorf("want %d versions, got %d", 855, len(xl.versions))
    		}
    		xl.sortByModTime()
    		if !sort.SliceIsSorted(xl.versions, func(i, j int) bool {
    			return xl.versions[i].header.ModTime > xl.versions[j].header.ModTime
    		}) {
    			t.Errorf("Contents not sorted")
    		}
    		for i := range xl.versions {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Mar 08 17:50:48 UTC 2024
    - 36.4K bytes
    - Viewed (0)
Back to top