Skip to content

Commit 45b09b0

Browse files
author
Dr. Brandon Wiley
committed
style changes, minor
1 parent f6000bf commit 45b09b0

File tree

1 file changed

+5
-7
lines changed
  • Codex/src/main/java/org/operatorfoundation/codex

1 file changed

+5
-7
lines changed

Codex/src/main/java/org/operatorfoundation/codex/Decoder.kt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package org.operatorfoundation.codex
22

3-
import org.operatorfoundation.codex.symbols.Power
4-
import org.operatorfoundation.codex.symbols.Binary
53
import org.operatorfoundation.codex.symbols.Symbol
64

75
/**
@@ -15,7 +13,6 @@ import org.operatorfoundation.codex.symbols.Symbol
1513
*/
1614
class Decoder(private val symbols: List<Symbol>)
1715
{
18-
1916
/**
2017
* Creates an Encoder instance with the same symbol list.
2118
*/
@@ -53,10 +50,11 @@ class Decoder(private val symbols: List<Symbol>)
5350
*/
5451
private fun decodeStep(encodedValue: ByteArray, symbol: Symbol, index: Int): Int
5552
{
56-
return if (symbol.size() == 1) {
53+
if (symbol.size() == 1) {
5754
// Symbols with size 1 don't contribute to the numeric value
5855
println("decode_step(${encodedValue.decodeToString()}, $symbol, $index)")
59-
0
56+
57+
return 0
6058
}
6159
else
6260
{
@@ -65,7 +63,7 @@ class Decoder(private val symbols: List<Symbol>)
6563
if (index == symbols.size - 1)
6664
{
6765
// Last symbol: just return its decoded value
68-
symbol.decode(encodedValue)
66+
return symbol.decode(encodedValue)
6967
}
7068
else
7169
{
@@ -80,7 +78,7 @@ class Decoder(private val symbols: List<Symbol>)
8078
val result = symbol.decode(encodedValue) * p
8179
println("result: $result")
8280

83-
result
81+
return result
8482
}
8583
}
8684
}

0 commit comments

Comments
 (0)