Commit 56abf0cf authored by Dag Brattli's avatar Dag Brattli

Inline functions

parent 35390406
...@@ -10,7 +10,7 @@ module Core = ...@@ -10,7 +10,7 @@ module Core =
let inline isBit (c: char) = let inline isBit (c: char) =
uint32 c - uint32 '0' <= uint32 '1' - uint32 '0' uint32 c - uint32 '0' <= uint32 '1' - uint32 '0'
let parseBits count : Parser<_> = let inline parseBits count : Parser<_> =
manyMinMaxSatisfy count count isBit manyMinMaxSatisfy count count isBit
let parseUint2 = let parseUint2 =
...@@ -44,7 +44,7 @@ module Core = ...@@ -44,7 +44,7 @@ module Core =
| "001110" -> "N" | "011110" -> "^" | "101110" -> "." | "111110" -> ">" | "001110" -> "N" | "011110" -> "^" | "101110" -> "." | "111110" -> ">"
| "001111" -> "O" | "011111" -> "_" | "101111" -> "/" | _ -> "?" | "001111" -> "O" | "011111" -> "_" | "101111" -> "/" | _ -> "?"
let parseAscii count = let inline parseAscii count =
let chars = count / 6 let chars = count / 6
let reducer x y = let reducer x y =
......
...@@ -40,9 +40,9 @@ module Type123 = ...@@ -40,9 +40,9 @@ module Type123 =
} }
let parseRateOfTurn = let parseRateOfTurn =
let square x = x * x * float(Math.Sign(float x)) let inline squareSigned x = x * x * float(Math.Sign(float x))
Core.parseSByte Core.parseSByte
|>> fun x -> square((float x) / 4.733) |>> fun x -> squareSigned((float x) / 4.733)
let parseSpeedOverGround = let parseSpeedOverGround =
Core.parseBits 10 Core.parseBits 10
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment