Skip to content

Commit ab8da66

Browse files
committed
WIP
1 parent d9d9f43 commit ab8da66

File tree

7 files changed

+25
-32
lines changed

7 files changed

+25
-32
lines changed

NOnion/Cells/CellAuthChallenge.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type CellAuthChallenge =
2020
methods
2121
else
2222
readMethod
23-
(methods @ [ ReadBigEndianUInt16 reader ])
23+
(ReadBigEndianUInt16 reader :: methods)
2424
(remainingCount - 1)
2525

2626
let challenge = reader.ReadBytes Constants.ChallangeLength

NOnion/Cells/CellCerts.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type CellCerts =
3333
}
3434

3535
readCertificates
36-
(certificates @ [ certificate ])
36+
(certificate :: certificates)
3737
(remainingCount - 1)
3838

3939
let certificatesCount = reader.ReadByte() |> int

NOnion/Cells/CellVersions.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type CellVersions =
2222
if reader.BaseStream.Length = reader.BaseStream.Position then
2323
versions
2424
else
25-
readVersions(versions @ [ ReadBigEndianUInt16 reader ])
25+
readVersions((ReadBigEndianUInt16 reader) :: versions)
2626

2727
let versions = readVersions List.empty
2828

NOnion/Cells/Relay/RelayIntroduce.fs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ type RelayIntroduceInnerData =
2525
state
2626
else
2727
readExtensionsList
28-
(state
29-
@ List.singleton(RelayIntroExtension.FromBytes reader))
28+
((RelayIntroExtension.FromBytes reader) :: state)
3029
(remainingCount - 1uy)
3130

3231
readExtensionsList List.empty extensionCount
@@ -105,8 +104,7 @@ type RelayIntroduce =
105104
state
106105
else
107106
readExtensionsList
108-
(state
109-
@ List.singleton(RelayIntroExtension.FromBytes reader))
107+
((RelayIntroExtension.FromBytes reader)::state)
110108
(remainingCount - 1uy)
111109

112110
readExtensionsList List.empty extensionCount

NOnion/Cells/Relay/RelayIntroduceAck.fs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ type RelayIntroduceAck =
3333
state
3434
else
3535
readExtensionsList
36-
(state
37-
@ List.singleton(RelayIntroExtension.FromBytes reader))
36+
(((RelayIntroExtension.FromBytes reader)) :: state)
3837
(remainingCount - 1uy)
3938

4039
readExtensionsList List.empty extensionCount

NOnion/Network/TorCircuit.fs

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -673,17 +673,15 @@ type TorCircuit
673673
circuitState <-
674674
Ready(
675675
circuitId,
676-
nodes
677-
@ List.singleton
678-
{
679-
TorCircuitNode.CryptoState =
680-
TorCryptoState.FromKdfResult
681-
(Kdf.ComputeHSKdf ntorKeySeed)
682-
true
683-
Window =
684-
TorWindow
685-
Constants.DefaultCircuitLevelWindowParams
686-
}
676+
{
677+
TorCircuitNode.CryptoState =
678+
TorCryptoState.FromKdfResult
679+
(Kdf.ComputeHSKdf ntorKeySeed)
680+
true
681+
Window =
682+
TorWindow
683+
Constants.DefaultCircuitLevelWindowParams
684+
} :: nodes
687685
)
688686

689687
do!
@@ -785,17 +783,15 @@ type TorCircuit
785783
circuitState <-
786784
Ready(
787785
circuitId,
788-
nodes
789-
@ List.singleton
790-
{
791-
TorCircuitNode.CryptoState =
792-
TorCryptoState.FromKdfResult
793-
kdfResult
794-
false
795-
Window =
796-
TorWindow
797-
Constants.DefaultCircuitLevelWindowParams
798-
}
786+
{
787+
TorCircuitNode.CryptoState =
788+
TorCryptoState.FromKdfResult
789+
kdfResult
790+
false
791+
Window =
792+
TorWindow
793+
Constants.DefaultCircuitLevelWindowParams
794+
} :: nodes
799795
)
800796

801797
tcs.SetResult circuitId

NOnion/Utility/Base32Util.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,4 +163,4 @@ module Base32Util =
163163
tail
164164
| _ -> result
165165

166-
[ for c in text -> c ] |> parse [] |> List.toArray
166+
[ for c in text -> c ] |> parse List.Empty |> List.toArray

0 commit comments

Comments
 (0)