Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 344 for slice (0.15 sec)

  1. src/cmd/asm/internal/lex/slice.go

    	"cmd/internal/src"
    )
    
    // A Slice reads from a slice of Tokens.
    type Slice struct {
    	tokens []Token
    	base   *src.PosBase
    	line   int
    	pos    int
    }
    
    func NewSlice(base *src.PosBase, line int, tokens []Token) *Slice {
    	return &Slice{
    		tokens: tokens,
    		base:   base,
    		line:   line,
    		pos:    -1, // Next will advance to zero.
    	}
    }
    
    func (s *Slice) Next() ScanToken {
    	s.pos++
    Go
    - Registered: Tue Apr 16 11:13:10 GMT 2024
    - Last Modified: Thu Jun 29 22:49:50 GMT 2023
    - 1.6K bytes
    - Viewed (0)
  2. guava-tests/test/com/google/common/io/ByteSourceTester.java

      public void testSlice_constrainedRange() throws IOException {
        long size = source.read().length;
        if (size >= 2) {
          ByteSource sliced = source.slice(1, size - 2);
          assertEquals(size - 2, sliced.read().length);
          ByteSource resliced = sliced.slice(0, size - 1);
          assertTrue(sliced.contentEquals(resliced));
        }
      }
    
      private void assertExpectedBytes(byte[] readBytes) {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 8.6K bytes
    - Viewed (0)
  3. tests/associations_has_many_test.go

    		&Pet{Name: "pet-slice-append-1"},
    		[]*Pet{{Name: "pet-slice-append-2-1"}, {Name: "pet-slice-append-2-2"}},
    		&Pet{Name: "pet-slice-append-3"},
    	)
    
    	AssertAssociationCount(t, users, "Pets", 10, "After Append")
    
    	// Replace -> same as append
    	DB.Model(&users).Association("Pets").Replace(
    		[]*Pet{{Name: "pet-slice-replace-1-1"}, {Name: "pet-slice-replace-1-2"}},
    Go
    - Registered: Sun Apr 14 09:35:11 GMT 2024
    - Last Modified: Fri Dec 15 08:36:08 GMT 2023
    - 15.6K bytes
    - Viewed (0)
  4. src/builtin/builtin.go

    // it has sufficient capacity, the destination is resliced to accommodate the
    // new elements. If it does not, a new underlying array will be allocated.
    // Append returns the updated slice. It is therefore necessary to store the
    // result of append, often in the variable holding the slice itself:
    //
    //	slice = append(slice, elem1, elem2)
    //	slice = append(slice, anotherSlice...)
    //
    Go
    - Registered: Tue Apr 16 11:13:10 GMT 2024
    - Last Modified: Thu Apr 11 20:22:45 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  5. src/bytes/bytes.go

    }
    
    // Compare returns an integer comparing two byte slices lexicographically.
    // The result will be 0 if a == b, -1 if a < b, and +1 if a > b.
    // A nil argument is equivalent to an empty slice.
    func Compare(a, b []byte) int {
    	return bytealg.Compare(a, b)
    }
    
    // explode splits s into a slice of UTF-8 sequences, one per Unicode code point (still slices of bytes),
    // up to a maximum of n byte slices. Invalid UTF-8 sequences are chopped into individual bytes.
    Go
    - Registered: Tue Apr 16 11:13:10 GMT 2024
    - Last Modified: Mon Feb 19 19:51:15 GMT 2024
    - 33.8K bytes
    - Viewed (0)
  6. android/guava-tests/test/com/google/common/io/ByteSourceTest.java

       * the offset at which the slice is supposed to start.
       */
      // TODO(cgdecker): Maybe add a test for this to ByteSourceTester
      public void testSlice_appendingAfterSlicing() throws IOException {
        // Source of length 5
        AppendableByteSource source = new AppendableByteSource(newPreFilledByteArray(5));
    
        // Slice it starting at offset 10.
        ByteSource slice = source.slice(10, 5);
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 16.9K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/io/ByteSourceTester.java

      public void testSlice_constrainedRange() throws IOException {
        long size = source.read().length;
        if (size >= 2) {
          ByteSource sliced = source.slice(1, size - 2);
          assertEquals(size - 2, sliced.read().length);
          ByteSource resliced = sliced.slice(0, size - 1);
          assertTrue(sliced.contentEquals(resliced));
        }
      }
    
      private void assertExpectedBytes(byte[] readBytes) {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 8.6K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/io/ByteSourceTest.java

       * the offset at which the slice is supposed to start.
       */
      // TODO(cgdecker): Maybe add a test for this to ByteSourceTester
      public void testSlice_appendingAfterSlicing() throws IOException {
        // Source of length 5
        AppendableByteSource source = new AppendableByteSource(newPreFilledByteArray(5));
    
        // Slice it starting at offset 10.
        ByteSource slice = source.slice(10, 5);
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 16.9K bytes
    - Viewed (0)
  9. src/bytes/buffer.go

    // Bytes returns a slice of length b.Len() holding the unread portion of the buffer.
    // The slice is valid for use only until the next buffer modification (that is,
    // only until the next call to a method like [Buffer.Read], [Buffer.Write], [Buffer.Reset], or [Buffer.Truncate]).
    // The slice aliases the buffer content at least until the next buffer modification,
    // so immediate changes to the slice will affect the result of future reads.
    Go
    - Registered: Tue Apr 16 11:13:10 GMT 2024
    - Last Modified: Fri Oct 13 17:10:31 GMT 2023
    - 15.7K bytes
    - Viewed (0)
  10. tests/create_test.go

    		CheckPet(t, pet2, pet)
    	})
    
    	t.Run("Slice", func(t *testing.T) {
    		pets := []Pet{{
    			Name: "PolymorphicHasOne-Slice-1",
    			Toy:  Toy{Name: "Toy-PolymorphicHasOne-Slice-1"},
    		}, {
    			Name: "PolymorphicHasOne-Slice-2",
    			Toy:  Toy{Name: "Toy-PolymorphicHasOne-Slice-2"},
    		}, {
    			Name: "PolymorphicHasOne-Slice-3",
    			Toy:  Toy{Name: "Toy-PolymorphicHasOne-Slice-3"},
    		}}
    
    Go
    - Registered: Sun Apr 14 09:35:11 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 26.4K bytes
    - Viewed (0)
Back to top