Premature optimization and all that...
Unified · Split
| @@ -222,11 +222,12 @@ let wcmd cmd fmt = · 221 unmodified lines | |||
| 222 | ) b fmt | 222 | ) b fmt |
| 223 | ;; | 223 | ;; |
| 224 | 224 | ||
| 225 | let wcmd1 cmd opaque = let s = ~> opaque in | 225 | let wcmd1 cmd opaque = |
| 226 | let s = ~> opaque in | ||
| 226 | let l = String.length s in | 227 | let l = String.length s in |
| 227 | let b = Bytes.create (l+1) in | 228 | let b = Bytes.create (l+1) in |
| 228 | Bytes.set b 0 cmd; | 229 | Bytes.set b l cmd; |
| 229 | Bytes.blit_string s 0 b 1 l; | 230 | Bytes.blit_string s 0 b 0 l; |
| 230 | Ffi.wcmd state.ss b @@ l + 1; | 231 | Ffi.wcmd state.ss b @@ l + 1; |
| 231 | ;; | 232 | ;; |
| 232 | 233 | ||