MCPcopy
hub / github.com/go-yaml/yaml / width

Function width

yamlprivateh.go:181–198  ·  view source on GitHub ↗

Determine the width of the character.

(b byte)

Source from the content-addressed store, hash-verified

179
180// Determine the width of the character.
181func width(b byte) int {
182 // Don't replace these by a switch without first
183 // confirming that it is being inlined.
184 if b&0x80 == 0x00 {
185 return 1
186 }
187 if b&0xE0 == 0xC0 {
188 return 2
189 }
190 if b&0xF0 == 0xE0 {
191 return 3
192 }
193 if b&0xF8 == 0xF0 {
194 return 4
195 }
196 return 0
197
198}

Callers 13

skipFunction · 0.85
skip_lineFunction · 0.85
readFunction · 0.85
writeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected