Skip to content

Commit 6223f85

Browse files
committed
WIP
1 parent d9d9f43 commit 6223f85

File tree

10 files changed

+30
-41
lines changed

10 files changed

+30
-41
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/CellNetInfo.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type CellNetInfo =
3232
addresses
3333
else
3434
readAddresses
35-
(addresses @ [ readAddress() ])
35+
(readAddress() :: addresses)
3636
(remainingCount - 1uy)
3737

3838
let time = ReadBigEndianUInt32 reader

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/RelayEstablishIntro.fs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ type RelayEstablishIntro =
133133
state
134134
else
135135
readExtensionsList
136-
(state
137-
@ List.singleton(RelayIntroExtension.FromBytes reader))
136+
((RelayIntroExtension.FromBytes reader) :: state)
138137
(remainingCount - 1uy)
139138

140139
readExtensionsList List.empty extensionCount

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/Directory/HiddenServiceDescriptorDocument.fs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,7 @@ type HiddenServiceDescriptorDocument =
246246
| "introduction-point" ->
247247
{ state with
248248
IntroductionPoints =
249-
state.IntroductionPoints
250-
@ List.singleton(IntroductionPointEntry.Parse lines)
249+
(IntroductionPointEntry.Parse lines) :: state.IntroductionPoints
251250
}
252251
| _ ->
253252
lines.Dequeue() |> ignore<string>

NOnion/Network/TorCircuit.fs

Lines changed: 19 additions & 25 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
@@ -960,8 +956,6 @@ type TorCircuit
960956
circuitState <-
961957
Ready(
962958
circuitId,
963-
nodes
964-
@ List.singleton
965959
{
966960
TorCircuitNode.CryptoState =
967961
TorCryptoState.FromKdfResult
@@ -971,7 +965,7 @@ type TorCircuit
971965
Window =
972966
TorWindow
973967
Constants.DefaultCircuitLevelWindowParams
974-
}
968+
} :: nodes
975969
)
976970

977971
tcs.SetResult()

NOnion/Utility/Base32Util.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ module Base32Util =
9696
| x0 :: [] -> result @ quintupletToList 1 (x0, 0uy, 0uy, 0uy, 0uy)
9797
| [] -> result
9898

99-
data |> Array.toList |> parse [] |> List.toArray |> System.String.Concat
99+
data |> Array.toList |> parse List.Empty |> List.toArray |> System.String.Concat
100100

101101
/// Decodes a Base32 string to a UTF8 string
102102
let DecodeBase32 text =
@@ -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)