Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 101 for compact (0.17 sec)

  1. cmd/data-scanner.go

    	}
    
    	if !into.Compacted && f.newCache.Info.Name != folder.name {
    		flat := f.newCache.sizeRecursive(thisHash.Key())
    		flat.Compacted = true
    		var compact bool
    		if flat.Objects < dataScannerCompactLeastObject {
    			compact = true
    		} else {
    			// Compact if we only have objects as children...
    			compact = true
    			for k := range into.Children {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Apr 15 09:40:19 GMT 2024
    - 46.9K bytes
    - Viewed (0)
  2. src/bytes/buffer_test.go

    	}
    	c, err := b.ReadByte()
    	if err != nil {
    		t.Fatalf("ReadByte: %v", err)
    	}
    	if c != 'm' {
    		t.Errorf("ReadByte = %q; want %q", c, 'm')
    	}
    }
    
    // Tests that we occasionally compact. Issue 5154.
    func TestBufferGrowth(t *testing.T) {
    	var b Buffer
    	buf := make([]byte, 1024)
    	b.Write(buf[0:1])
    	var cap0 int
    	for i := 0; i < 5<<10; i++ {
    		b.Write(buf)
    		b.Read(buf)
    		if i == 0 {
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Apr 20 01:07:29 GMT 2023
    - 18.1K bytes
    - Viewed (0)
  3. cmd/data-usage-cache.go

    	e, ok := d.Cache[path.Key()]
    	if !ok {
    		return
    	}
    	if e.Compacted {
    		return
    	}
    	// If direct children have more, compact all.
    	if len(e.Children) > limit && compactSelf {
    		flat := d.sizeRecursive(path.Key())
    		flat.Compacted = true
    		d.deleteRecursive(path)
    		d.replaceHashed(path, nil, *flat)
    		return
    	}
    	total := d.totalChildrenRec(path.Key())
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 41.3K bytes
    - Viewed (1)
  4. src/bytes/compare_test.go

    			copy(shiftedB, tt.b)
    			cmp := Compare(tt.a, shiftedB)
    			if cmp != tt.i {
    				t.Errorf(`Compare(%q, %q), offset %d = %v; want %v`, tt.a, tt.b, offset, cmp, tt.i)
    			}
    		}
    	}
    }
    
    func TestCompareIdenticalSlice(t *testing.T) {
    	var b = []byte("Hello Gophers!")
    	if Compare(b, b) != 0 {
    		t.Error("b != b")
    	}
    	if Compare(b, b[:1]) != 1 {
    		t.Error("b > b[:1] failed")
    	}
    }
    
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Jul 13 23:11:42 GMT 2023
    - 6.8K bytes
    - Viewed (0)
  5. tests/count_test.go

    )
    
    func TestCountWithGroup(t *testing.T) {
    	DB.Create([]Company{
    		{Name: "company_count_group_a"},
    		{Name: "company_count_group_a"},
    		{Name: "company_count_group_a"},
    		{Name: "company_count_group_b"},
    		{Name: "company_count_group_c"},
    	})
    
    	var count1 int64
    	if err := DB.Model(&Company{}).Where("name = ?", "company_count_group_a").Group("name").Count(&count1).Error; err != nil {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 6.9K bytes
    - Viewed (0)
  6. tests/helper_test.go

    	}
    
    	for i := 0; i < config.Tools; i++ {
    		user.Tools = append(user.Tools, Tools{Name: name + "_tool_" + strconv.Itoa(i+1)})
    	}
    
    	if config.Company {
    		user.Company = Company{Name: "company-" + name}
    	}
    
    	if config.Manager {
    		user.Manager = GetUser(name+"_manager", Config{})
    	}
    
    	for i := 0; i < config.Team; i++ {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 8K bytes
    - Viewed (0)
  7. tests/update_test.go

    	if result.Name != "new company name" {
    		t.Errorf("name should be %v, but got %v", user.Company.Name, result.Name)
    	}
    }
    
    func TestIdempotentSave(t *testing.T) {
    	create := Company{
    		Name: "company_idempotent",
    	}
    	DB.Create(&create)
    
    	var company Company
    	if err := DB.Find(&company, "id = ?", create.ID).Error; err != nil {
    		t.Fatalf("failed to find created company, got err: %v", err)
    	}
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
  8. tests/create_test.go

    	}
    }
    
    func TestFirstOrCreateWithPrimaryKey(t *testing.T) {
    	company := Company{ID: 100, Name: "company100_with_primarykey"}
    	DB.FirstOrCreate(&company)
    
    	if company.ID != 100 {
    		t.Errorf("invalid primary key after creating, got %v", company.ID)
    	}
    
    	companies := []Company{
    		{ID: 101, Name: "company101_with_primarykey"},
    		{ID: 102, Name: "company102_with_primarykey"},
    	}
    	DB.Create(&companies)
    
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 26.4K bytes
    - Viewed (0)
  9. tests/joins_test.go

    	}
    
    	CheckUser(t, user2, user)
    }
    
    func TestJoinsForSlice(t *testing.T) {
    	users := []User{
    		*GetUser("slice-joins-1", Config{Company: true, Manager: true, Account: true}),
    		*GetUser("slice-joins-2", Config{Company: true, Manager: true, Account: true}),
    		*GetUser("slice-joins-3", Config{Company: true, Manager: true, Account: true}),
    	}
    
    	DB.Create(&users)
    
    	var userIDs []uint
    	for _, user := range users {
    Go
    - Registered: Sun Apr 21 09:35:09 GMT 2024
    - Last Modified: Wed Apr 26 14:19:32 GMT 2023
    - 13.5K bytes
    - Viewed (1)
  10. istioctl/pkg/writer/ztunnel/configdump/policies.go

    	w := c.tabwriter()
    	zDump := c.ztunnelDump
    
    	pols := slices.Filter(maps.Values(zDump.Policies), filter.Verify)
    	slices.SortFunc(pols, func(a, b *ZtunnelPolicy) int {
    		if r := cmp.Compare(a.Namespace, b.Namespace); r != 0 {
    			return r
    		}
    		return cmp.Compare(a.Name, b.Name)
    	})
    	fmt.Fprintln(w, "NAMESPACE\tPOLICY NAME\tACTION\tSCOPE")
    
    	for _, pol := range pols {
    		fmt.Fprintf(w, "%v\t%v\t%v\t%v\n",
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Tue Apr 23 21:30:30 GMT 2024
    - 2.5K bytes
    - Viewed (0)
Back to top