Skip to content

Commit ae9a69b

Browse files
authored
doc: add missing word in union section (#24926)
1 parent 6dad361 commit ae9a69b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎doc/docs.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2867,12 +2867,12 @@ automatically modifies all the rest. The largest union member defines the size o
28672867

28682868
One reason, as stated above, is to use less memory for storing things. Since the size of a union
28692869
is the size of the largest field in it, and the size of a struct is the size of all the fields in
2870-
struct added together, a union is definitely better for lower memory usage. As long as you only
2871-
need one of the fields to be valid at any time, the union wins.
2870+
the struct added together, a union is definitely better for lower memory usage. As long as you
2871+
only need one of the fields to be valid at any time, the union wins.
28722872

28732873
Another reason is to allow easier access to parts of a field. For example, without using a union,
28742874
if you want to look at each of the bytes of a 32-bit integer separately, you'll need bitwise
2875-
RIGHT-SHIFTs and AND operations. With a union, you can access the individual bytes directly.
2875+
`RIGHT-SHIFT`s and `AND` operations. With a union, you can access the individual bytes directly.
28762876
```v
28772877
union ThirtyTwo {
28782878
a u32
@@ -8397,4 +8397,4 @@ This is the place to be, to discuss the V language, learn about latest
83978397
developments, quickly get help with issues, witness/participate in
83988398
~~epic flame wars~~ constructive criticism exchanges and design decisions.
83998399
Join it, and learn more about languages, games, editors, people, Klingons,
8400-
Conway's law and the universe.
8400+
Conway's law and the universe.

0 commit comments

Comments
 (0)