Commit 2f61f74
committed
Improve Tuple+Versionstamp code quality and readability
- Use count(where:) instead of reduce for counting incomplete versionstamps
This is more idiomatic Swift and clearly expresses intent
- Replace guard with if for incompleteCount validation
Guard is for early returns; if is more appropriate here
- Optimize withUnsafeBytes to eliminate unnecessary allocation
Append directly instead of creating intermediate Array
Addresses: glbrntt review comments FoundationDB#6, FoundationDB#7, FoundationDB#101 parent 7f8a07a commit 2f61f74
1 file changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
113 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
0 commit comments