Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 20 for countrunes (0.14 sec)

  1. test/codegen/strings.go

    // license that can be found in the LICENSE file.
    
    package codegen
    
    // This file contains code generation tests related to the handling of
    // string types.
    
    func CountRunes(s string) int { // Issue #24923
    	// amd64:`.*countrunes`
    	return len([]rune(s))
    }
    
    func CountBytes(s []byte) int {
    	// amd64:-`.*runtime.slicebytetostring`
    	return len(string(s))
    }
    
    func ToByteSlice() []byte { // Issue #24698
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jul 26 17:17:28 UTC 2023
    - 2.4K bytes
    - Viewed (0)
  2. src/runtime/utf8.go

    	rune1Max = 1<<7 - 1
    	rune2Max = 1<<11 - 1
    	rune3Max = 1<<16 - 1
    
    	// The default lowest and highest continuation byte.
    	locb = 0x80 // 1000 0000
    	hicb = 0xBF // 1011 1111
    )
    
    // countrunes returns the number of runes in s.
    func countrunes(s string) int {
    	n := 0
    	for range s {
    		n++
    	}
    	return n
    }
    
    // decoderune returns the non-ASCII rune at the start of
    // s[k:] and the index after the rune in s.
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 06 02:46:02 UTC 2020
    - 3.4K bytes
    - Viewed (0)
  3. src/cmd/internal/goobj/builtinlist.go

    	{"runtime.slicebytetostringtmp", 1},
    	{"runtime.slicerunetostring", 1},
    	{"runtime.stringtoslicebyte", 1},
    	{"runtime.stringtoslicerune", 1},
    	{"runtime.slicecopy", 1},
    	{"runtime.decoderune", 1},
    	{"runtime.countrunes", 1},
    	{"runtime.convT", 1},
    	{"runtime.convTnoptr", 1},
    	{"runtime.convT16", 1},
    	{"runtime.convT32", 1},
    	{"runtime.convT64", 1},
    	{"runtime.convTstring", 1},
    	{"runtime.convTslice", 1},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 21 21:08:03 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/typecheck/_builtin/runtime.go

    func stringtoslicerune(*[32]rune, string) []rune
    func slicecopy(toPtr *any, toLen int, fromPtr *any, fromLen int, wid uintptr) int
    
    func decoderune(string, int) (retv rune, retk int)
    func countrunes(string) int
    
    // Convert non-interface type to the data word of a (empty or nonempty) interface.
    func convT(typ *byte, elem *any) unsafe.Pointer
    
    // Same as convT, for types with no pointers in them.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 21 21:08:03 UTC 2024
    - 10.6K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/walk/builtin.go

    }
    
    // walkLenCap walks an OLEN or OCAP node.
    func walkLenCap(n *ir.UnaryExpr, init *ir.Nodes) ir.Node {
    	if isRuneCount(n) {
    		// Replace len([]rune(string)) with runtime.countrunes(string).
    		return mkcall("countrunes", n.Type(), init, typecheck.Conv(n.X.(*ir.ConvExpr).X, types.Types[types.TSTRING]))
    	}
    	if isByteCount(n) {
    		conv := n.X.(*ir.ConvExpr)
    		walkStmtList(conv.Init())
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 22:35:22 UTC 2024
    - 31.2K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/typecheck/builtin.go

    	{"slicebytetostringtmp", funcTag, 45},
    	{"slicerunetostring", funcTag, 48},
    	{"stringtoslicebyte", funcTag, 50},
    	{"stringtoslicerune", funcTag, 53},
    	{"slicecopy", funcTag, 54},
    	{"decoderune", funcTag, 55},
    	{"countrunes", funcTag, 56},
    	{"convT", funcTag, 57},
    	{"convTnoptr", funcTag, 57},
    	{"convT16", funcTag, 59},
    	{"convT32", funcTag, 61},
    	{"convT64", funcTag, 62},
    	{"convTstring", funcTag, 63},
    	{"convTslice", funcTag, 66},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 21 21:08:03 UTC 2024
    - 16.2K bytes
    - Viewed (0)
  7. src/unicode/utf8/utf8_test.go

    				testSequence(t, s)
    			}
    		}
    	}
    }
    
    func runtimeRuneCount(s string) int {
    	return len([]rune(s)) // Replaced by gc with call to runtime.countrunes(s).
    }
    
    // Check that a range loop, len([]rune(string)) optimization and
    // []rune conversions visit the same runes.
    // Not really a test of this package, but the assumption is used here and
    // it's good to verify.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 07 06:17:15 UTC 2022
    - 16.2K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/walk/order.go

    		ir.OMAX,
    		ir.OMIN,
    		ir.ONEW,
    		ir.OREAL,
    		ir.ORECOVERFP,
    		ir.OSTR2BYTES,
    		ir.OSTR2BYTESTMP,
    		ir.OSTR2RUNES:
    
    		if isRuneCount(n) {
    			// len([]rune(s)) is rewritten to runtime.countrunes(s) later.
    			conv := n.(*ir.UnaryExpr).X.(*ir.ConvExpr)
    			conv.X = o.expr(conv.X, nil)
    		} else {
    			o.call(n)
    		}
    
    		if lhs == nil || lhs.Op() != ir.ONAME || base.Flag.Cfg.Instrumenting {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 02:00:33 UTC 2024
    - 42.7K bytes
    - Viewed (0)
  9. platforms/core-configuration/kotlin-dsl-tooling-builders/src/main/kotlin/org/gradle/kotlin/dsl/tooling/builders/EditorReportsBuilder.kt

    }
    
    
    internal
    fun File.readLinesRange() =
        countLines().let { count ->
            if (count == 0L) 0..0L
            else 1..count
        }
    
    
    private
    fun File.countLines(): Long =
        inputStream().buffered().use { input ->
            input.countLines()
        }
    
    
    private
    fun BufferedInputStream.countLines(): Long {
        val buffer = ByteArray(DEFAULT_BUFFER_SIZE)
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Jan 12 19:30:55 UTC 2024
    - 6.2K bytes
    - Viewed (0)
  10. src/main/webapp/js/admin/plugins/form-validator/location.js

    module&&module.exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(a){a.formUtils.registerLoadedModule("location"),a.formUtils.addValidator({name:"country",validatorFunction:function(b){return a.inArray(b.toLowerCase(),this.countries)>-1},countries:["afghanistan","albania","algeria","american samoa","andorra","angola","anguilla","antarctica","antigua and barbuda","argentina","armenia","aruba","australia","austria","azerbaijan","bahamas","bahrain","bangladesh","barbados","belarus","...
    Registered: Wed Jun 12 13:08:18 UTC 2024
    - Last Modified: Mon Jan 01 05:12:47 UTC 2018
    - 5.2K bytes
    - Viewed (0)
Back to top