Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 18 for PushBack (0.13 sec)

  1. src/cmd/compile/internal/ssa/testdata/pushback.go

    	v V
    	Node
    }
    
    type List[V any] struct {
    	root *ExtNode[V]
    	len  int
    }
    
    func (list *List[V]) PushBack(arg V) {
    	if list.len == 0 {
    		list.root = &ExtNode[V]{v: arg}
    		list.root.Circular = true
    		list.len++
    		return
    	}
    	list.len++
    }
    
    func main() {
    	var v List[int]
    	v.PushBack(1)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 09 20:47:54 UTC 2021
    - 360 bytes
    - Viewed (0)
  2. test/typeparam/list2.go

    	var l _List[int]
    	l.PushBack(1)
    	l.PushBack(2)
    	l.PushBack(3)
    	l.InsertBefore(1, new(_Element[int]))
    	checkList(&l, []interface{}{1, 2, 3})
    }
    
    // Test that a list l is not modified when calling InsertAfter with a mark that is not an element of l.
    func TestInsertAfterUnknownMark() {
    	var l _List[int]
    	l.PushBack(1)
    	l.PushBack(2)
    	l.PushBack(3)
    	l.InsertAfter(1, new(_Element[int]))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 15.3K bytes
    - Viewed (0)
  3. test/typeparam/listimp2.dir/main.go

    	var l a.List[int]
    	l.PushBack(1)
    	l.PushBack(2)
    	l.PushBack(3)
    	l.InsertBefore(1, new(a.Element[int]))
    	checkList(&l, []interface{}{1, 2, 3})
    }
    
    // Test that a list l is not modified when calling InsertAfter with a mark that is not an element of l.
    func TestInsertAfterUnknownMark() {
    	var l a.List[int]
    	l.PushBack(1)
    	l.PushBack(2)
    	l.PushBack(3)
    	l.InsertAfter(1, new(a.Element[int]))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 24 02:14:15 UTC 2022
    - 7.4K bytes
    - Viewed (0)
  4. src/container/list/list_test.go

    	var l List
    	l.PushBack(1)
    	l.PushBack(2)
    	l.PushBack(3)
    	l.InsertBefore(1, new(Element))
    	checkList(t, &l, []any{1, 2, 3})
    }
    
    // Test that a list l is not modified when calling InsertAfter with a mark that is not an element of l.
    func TestInsertAfterUnknownMark(t *testing.T) {
    	var l List
    	l.PushBack(1)
    	l.PushBack(2)
    	l.PushBack(3)
    	l.InsertAfter(1, new(Element))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 7.7K bytes
    - Viewed (0)
  5. platforms/native/language-native/src/main/java/org/gradle/language/nativeplatform/internal/incremental/sourceparser/PreprocessingReader.java

                if (followingChar == '\n') {
                    return true; // '\\\r\n' discarded from stream
                }
                pushBack(nextChar);
                pushBack(followingChar);
                return false;
            } else {
                pushBack(nextChar);
                return false;
            }
        }
    
        private int next() throws IOException {
            if (readAheadChars[0] != -1) {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Nov 16 20:20:03 UTC 2023
    - 5.1K bytes
    - Viewed (0)
  6. src/container/list/example_test.go

    // license that can be found in the LICENSE file.
    
    package list_test
    
    import (
    	"container/list"
    	"fmt"
    )
    
    func Example() {
    	// Create a new list and put some numbers in it.
    	l := list.New()
    	e4 := l.PushBack(4)
    	e1 := l.PushFront(1)
    	l.InsertBefore(3, e4)
    	l.InsertAfter(2, e1)
    
    	// Iterate through list and print its contents.
    	for e := l.Front(); e != nil; e = e.Next() {
    		fmt.Println(e.Value)
    	}
    
    	// Output:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 08 04:08:51 UTC 2014
    - 549 bytes
    - Viewed (0)
  7. test/typeparam/listimp2.dir/a.go

    func (l *List[T]) PushFront(v T) *Element[T] {
    	l.lazyInit()
    	return l.insertValue(v, &l.root)
    }
    
    // PushBack inserts a new element e with value v at the back of list l and returns e.
    func (l *List[T]) PushBack(v T) *Element[T] {
    	l.lazyInit()
    	return l.insertValue(v, l.root.prev)
    }
    
    // InsertBefore inserts a new element e with value v immediately before mark and returns e.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jul 28 21:40:40 UTC 2021
    - 8K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/ssa/debug_lines_test.go

    	default:
    		t.Skip("skipped for many architectures")
    
    	case "arm64", "amd64": // register ABI
    		fn := "(*List[go.shape.int_0]).PushBack"
    		if true /* was buildcfg.Experiment.Unified */ {
    			// Unified mangles differently
    			fn = "(*List[go.shape.int]).PushBack"
    		}
    		testDebugLines(t, "-N -l", "pushback.go", fn, []int{17, 18, 19, 20, 21, 22, 24}, true)
    	}
    }
    
    func TestDebugLinesConvert(t *testing.T) {
    	unixOnly(t)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 21 20:24:52 UTC 2023
    - 8.4K bytes
    - Viewed (0)
  9. src/container/list/list.go

    func (l *List) PushFront(v any) *Element {
    	l.lazyInit()
    	return l.insertValue(v, &l.root)
    }
    
    // PushBack inserts a new element e with value v at the back of list l and returns e.
    func (l *List) PushBack(v any) *Element {
    	l.lazyInit()
    	return l.insertValue(v, l.root.prev)
    }
    
    // InsertBefore inserts a new element e with value v immediately before mark and returns e.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 16:34:30 UTC 2022
    - 6.3K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/queueset/fifo_list.go

    	}
    }
    
    func (l *requestFIFO) Length() int {
    	return l.Len()
    }
    
    func (l *requestFIFO) QueueSum() queueSum {
    	return l.sum
    }
    
    func (l *requestFIFO) Enqueue(req *request) removeFromFIFOFunc {
    	e := l.PushBack(req)
    	addToQueueSum(&l.sum, req)
    
    	return func() *request {
    		if e.Value == nil {
    			return nil
    		}
    		l.Remove(e)
    		e.Value = nil
    		deductFromQueueSum(&l.sum, req)
    		return req
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Oct 20 16:05:53 UTC 2021
    - 3.9K bytes
    - Viewed (0)
Back to top