// Reflect changes the content with its reflection with respect to a middle
// vertical axis (order of characters in each line reversed). The result has
// the same size.
Reflect changes the content with its reflection with respect to a middle
vertical axis (order of characters in each line reversed). The result has
the same size.
// Reflect changes the content with its reflection with respect to a middle // vertical axis ( order of characters in each line reversed ) . The result has // the same size .
func (v *Vault) Reflect() {
	sb := strings.Builder{}
	sb.Grow(len(v.content))
	line := make([]rune, 0, v.Size().X)
	for _, r := range v.content {
		if r == '\n' {
			for i := len(line) - 1; i >= 0; i-- {
				sb.WriteRune(line[i])
			}
			sb.WriteRune('\n')
			line = line[:0]
			continue
		}
		line = append(line, r)
	}
	for i := len(line) - 1; i >= 0; i-- {
		sb.WriteRune(line[i])
	}
	v.content = sb.String()
}
func ( v * Vault ) Reflect ( ) { sb := strings . Builder { } sb . Grow ( len ( v . content ) ) line := make ( [ ] rune , 0 , v . Size ( ) . X ) for _ , r := range v . content { if r == '\n' { for i := len ( line ) - 1 ; i >= 0 ; i -- { sb . WriteRune ( line [ i ] ) } sb . WriteRune ( '\n' ) line = line [ : 0 ] continue } line = append ( line , r ) } for i := len ( line ) - 1 ; i >= 0 ; i -- { sb . WriteRune ( line [ i ] ) } v . content = sb . String ( ) }
Reflect changes the content with its reflection with respect to a middle
vertical axis (order of characters in each line reversed).
Reflect changes the content with its reflection with respect to a middle vertical axis ( order of characters in each line reversed ) .