Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for lcp (0.15 sec)

  1. cmd/utils_test.go

    		{[]string{"abcd/", ""}, ""},
    		{[]string{"abcd/foo/", "abcd/bar/"}, "abcd/"},
    		{[]string{"abcd/foo/bar/", "abcd/foo/bar/zoo"}, "abcd/foo/bar/"},
    	}
    
    	for i, test := range testCases {
    		foundPrefix := lcp(test.prefixes, true)
    		if foundPrefix != test.commonPrefix {
    			t.Fatalf("Test %d: Common prefix found: `%v`, expected: `%v`", i+1, foundPrefix, test.commonPrefix)
    		}
    	}
    }
    
    func TestGetMinioMode(t *testing.T) {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Feb 23 21:28:14 GMT 2024
    - 10.2K bytes
    - Viewed (0)
  2. cmd/utils.go

    	}
    	return accumulator
    }
    
    // Suffix returns the longest common suffix of the provided strings
    func lcpSuffix(strs []string) string {
    	return lcp(strs, false)
    }
    
    func lcp(strs []string, pre bool) string {
    	// short-circuit empty list
    	if len(strs) == 0 {
    		return ""
    	}
    	xfix := strs[0]
    	// short-circuit single-element list
    	if len(strs) == 1 {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Apr 24 04:08:47 GMT 2024
    - 31.3K bytes
    - Viewed (0)
Back to top