Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 29 for byteslice (0.2 sec)

  1. src/log/slog/text_handler.go

    			s.appendString(string(data))
    			return nil
    		}
    		if bs, ok := byteSlice(v.any); ok {
    			// As of Go 1.19, this only allocates for strings longer than 32 bytes.
    			s.buf.WriteString(strconv.Quote(string(bs)))
    			return nil
    		}
    		s.appendString(fmt.Sprintf("%+v", v.Any()))
    	default:
    		*s.buf = v.append(*s.buf)
    	}
    	return nil
    }
    
    // byteSlice returns its argument as a []byte if the argument's
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 23 22:56:07 UTC 2023
    - 4.7K bytes
    - Viewed (0)
  2. src/database/sql/convert_test.go

    		{s: 123, d: &scanint, wantint: 123},
    		{s: someTime, d: &scantime, wanttime: someTime},
    
    		// To strings
    		{s: "string", d: &scanstr, wantstr: "string"},
    		{s: []byte("byteslice"), d: &scanstr, wantstr: "byteslice"},
    		{s: 123, d: &scanstr, wantstr: "123"},
    		{s: int8(123), d: &scanstr, wantstr: "123"},
    		{s: int64(123), d: &scanstr, wantstr: "123"},
    		{s: uint8(123), d: &scanstr, wantstr: "123"},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 10 20:23:22 UTC 2024
    - 17K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/walk/order.go

    		o.exprList(n.List)
    
    		if len(n.List) > 5 {
    			t := types.NewArray(types.Types[types.TSTRING], int64(len(n.List)))
    			n.Prealloc = o.newTemp(t, false)
    		}
    
    		// Mark string(byteSlice) arguments to reuse byteSlice backing
    		// buffer during conversion. String concatenation does not
    		// memorize the strings for later use, so it is safe.
    		// However, we can do it only if there is at least one non-empty string literal.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 02:00:33 UTC 2024
    - 42.7K bytes
    - Viewed (0)
  4. src/encoding/json/decode_test.go

    	NilMap   map[string]Small
    
    	Slice   []Small
    	SliceP  []*Small
    	PSlice  *[]Small
    	PSliceP *[]*Small
    
    	EmptySlice []Small
    	NilSlice   []Small
    
    	StringSlice []string
    	ByteSlice   []byte
    
    	Small   Small
    	PSmall  *Small
    	PPSmall **Small
    
    	Interface  any
    	PInterface *any
    
    	unexported int
    }
    
    type Small struct {
    	Tag string
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 11 16:40:14 UTC 2024
    - 67.6K bytes
    - Viewed (0)
  5. src/net/textproto/reader.go

    		} else if !upper && 'A' <= c && c <= 'Z' {
    			c += toLower
    		}
    		a[i] = c
    		upper = c == '-' // for next time
    	}
    	commonHeaderOnce.Do(initCommonHeader)
    	// The compiler recognizes m[string(byteSlice)] as a special
    	// case, so a copy of a's bytes into a new string does not
    	// happen in this map lookup:
    	if v := commonHeader[string(a)]; v != "" {
    		return v, true
    	}
    	return string(a), true
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 19:57:43 UTC 2024
    - 22.1K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/walk/switch.go

    	// convert switch {...} to switch true {...}
    	if cond == nil {
    		cond = ir.NewBool(base.Pos, true)
    		cond = typecheck.Expr(cond)
    		cond = typecheck.DefaultLit(cond, nil)
    	}
    
    	// Given "switch string(byteslice)",
    	// with all cases being side-effect free,
    	// use a zero-cost alias of the byte slice.
    	// Do this before calling walkExpr on cond,
    	// because walkExpr will lower the string
    	// conversion into a runtime call.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:01 UTC 2024
    - 30.1K bytes
    - Viewed (0)
  7. test/fixedbugs/bug297.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // Used to crash; issue 961.
    
    package main
    
    type ByteSize float64
    
    const (
    	_           = iota          // ignore first value by assigning to blank identifier
    	KB ByteSize = 1 << (10 * X) // ERROR "undefined"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 05 18:46:48 UTC 2021
    - 395 bytes
    - Viewed (0)
  8. src/debug/dwarf/type.go

    // the zero value is used.
    type CommonType struct {
    	ByteSize int64  // size of value of this type, in bytes
    	Name     string // name that can be used to refer to type
    }
    
    func (c *CommonType) Common() *CommonType { return c }
    
    func (c *CommonType) Size() int64 { return c.ByteSize }
    
    // Basic types
    
    // A BasicType holds fields common to all basic types.
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 18 19:33:30 UTC 2023
    - 21.9K bytes
    - Viewed (0)
  9. tensorflow/compiler/mlir/tfr/ir/tfr_types.h

      static TFRTypeStorage* construct(TypeStorageAllocator& allocator, KeyTy key) {
        // Allocate a new storage instance.
        auto byteSize = TFRTypeStorage::totalSizeToAlloc<StringAttr>(key.size());
        auto rawMem = allocator.allocate(byteSize, alignof(TFRTypeStorage));
        auto result = ::new (rawMem) TFRTypeStorage(key.size());
    
        // Copy in the string attributes into the trailing storage.
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Tue Dec 05 07:17:01 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  10. tensorflow/cc/experimental/libtf/runtime/runtime.h

      // compatible.
      if (t->ByteSize() != sizeof(T) * data.size()) {
        return tensorflow::errors::InvalidArgument(absl::StrCat(
            "Invalid number of bytes in data buffer\n", "Expected bytes: ",
            t->ByteSize(), "\n", "Actual bytes: ", sizeof(T) * data.size()));
      }
      memcpy(t->Data(), data.data(), t->ByteSize());
      return Tensor(Convert(TaggedValue(
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Thu Sep 01 11:18:25 UTC 2022
    - 4.4K bytes
    - Viewed (0)
Back to top