Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Remove unused variables #33

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rawsrc/LaunchDarklyPlainText.brs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function LaunchDarklyPlainTextReader(launchDarklyParamCipherKey as Object, launchDarklyParamAuthKey as Object) as Object
function LaunchDarklyPlainTextReader() as Object
return {
private: {
stream: LaunchDarklyStream(),
Expand Down
10 changes: 3 additions & 7 deletions rawsrc/LaunchDarklyStreamClient.brs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function LaunchDarklyStreamClient(launchDarklyParamConfig as Object, launchDarkl
end while
end function

handleStreamMessage: function(launchDarklyParamMessage as Dynamic) as Void
handleStreamMessage: function() as Void
m.config.private.logger.debug("socket event")

if m.streamSocket = invalid then
Expand Down Expand Up @@ -297,9 +297,6 @@ function LaunchDarklyStreamClient(launchDarklyParamConfig as Object, launchDarkl

m.config.private.logger.debug("got shared secret")

launchDarklyLocalCipherKeyBuffer = launchDarklyLocalDecoded.cipherKey
launchDarklyLocalAuthKeyBuffer = launchDarklyLocalDecoded.authenticationKey

launchDarklyLocalCipherKey = createObject("roByteArray")
launchDarklyLocalCipherKey.fromBase64String(launchDarklyLocalDecoded.cipherKey)

Expand All @@ -311,7 +308,6 @@ function LaunchDarklyStreamClient(launchDarklyParamConfig as Object, launchDarkl

uriParts = m.util.extractUriParts(m.config.private.streamURI)
path = uriParts["path"] + "/mevalalternate"
launchDarklyLocalHostname = m.util.stripHTTPProtocol(m.config.private.streamURI)

launchDarklyLocalRequestText = ""
launchDarklyLocalRequestText += "POST " + path + " HTTP/1.1" + chr(13) + chr(10)
Expand All @@ -329,7 +325,7 @@ function LaunchDarklyStreamClient(launchDarklyParamConfig as Object, launchDarkl
launchDarklyLocalRequestText += chr(13) + chr(10)

if m.config.private.forcePlainTextInStream then
m.streamCrypto = LaunchDarklyPlainTextReader(launchDarklyLocalCipherKey, launchDarklyLocalAuthKey)
m.streamCrypto = LaunchDarklyPlainTextReader()
else
m.streamCrypto = LaunchDarklyCryptoReader(launchDarklyLocalCipherKey, launchDarklyLocalAuthKey)
end if
Expand Down Expand Up @@ -405,7 +401,7 @@ function LaunchDarklyStreamClient(launchDarklyParamConfig as Object, launchDarkl
end if
else if type(launchDarklyParamMessage) = "roSocketEvent" then
if m.private.streamSocket <> invalid AND launchDarklyParamMessage.getSocketID() = m.private.streamSocket.getID() then
m.private.handleStreamMessage(launchDarklyParamMessage)
m.private.handleStreamMessage()

return true
end if
Expand Down
15 changes: 0 additions & 15 deletions rawsrc/LaunchDarklyUtility.brs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ function LaunchDarklyUtility() as Object
end function,

littleEndianUnsignedToInteger: function(launchDarklyParamBytes as Object) as Integer
launchDarklyLocalCounter = 0
launchDarklyLocalOutput = 0

for launchDarklyLocalX = 0 to launchDarklyParamBytes.count() - 1 step + 1
Expand Down Expand Up @@ -298,20 +297,6 @@ function LaunchDarklyUtility() as Object
return values.Join(" ")
end function,

stripHTTPProtocol: function(launchDarklyParamRawURI as String) as String
launchDarklyLocalHTTPS = "https://"
launchDarklyLocalHTTP = "http://"

if left(launchDarklyParamRawURI, len(launchDarklyLocalHTTPS)) = launchdarklyLocalHTTPS then
return mid(launchDarklyParamRawURI, len(launchDarklyLocalHTTPS) + 1)
else if left(launchDarklyParamRawURI, len(launchDarklyLocalHTTP)) = launchDarklyLocalHTTP then
return mid(launchDarklyParamRawURI, len(launchDarklyLocalHTTP) + 1)
else
REM impossible in usage
return ""
end if
end function,

' Provides a simplistic approach at parsing out the bits of a URI.
'
' WARNING: This does not support IPv6.
Expand Down
2 changes: 1 addition & 1 deletion src/contract-tests/components/HttpServerTask.brs
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ function Handler(clients as Object, launchDarklyNode as Object) as Object
return m.makeResponse(200, "OK", result)
end function,

evaluateAll: function(client as Object, params as Object) as Object
evaluateAll: function(client as Object, _params as Object) as Object
result = {
state: client.allFlagsState()
}
Expand Down
4 changes: 2 additions & 2 deletions src/contract-tests/source/main.brs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
sub main(params as object)
sub main(_params as object)
print "in showChannelSGScreen"

screen = createObject("roSGScreen")
messagePort = createObject("roMessagePort")
screen.setMessagePort(messagePort)

scene = screen.CreateScene("AppScene")
_scene = screen.CreateScene("AppScene")

screen.show()

Expand Down
17 changes: 0 additions & 17 deletions src/test/source/tests/Test__Utility.brs
Original file line number Diff line number Diff line change
Expand Up @@ -117,22 +117,6 @@ function TestCase__Utility_Backoff() as String
return m.assertFalse(backoff.shouldWait())
end function

function TestCase__Utility_StripHTTPProtocol() as String
u = LaunchDarklyUtility()

a = m.assertEqual(u.stripHTTPProtocol("https://test.com"), "test.com")
if a <> "" then
return a
end if

a = m.assertEqual(u.stripHTTPProtocol("http://test.com"), "test.com")
if a <> "" then
return a
end if

return m.assertEqual(u.stripHTTPProtocol("test.com"), "")
end function

function TestCase__Utility_ExtractUriParts() as String
u = LaunchDarklyUtility()

Expand Down Expand Up @@ -198,7 +182,6 @@ function TestSuite__Utility() as Object
this.addTest("TestCase__Utility_IsValidHex", TestCase__Utility_IsValidHex)
this.addTest("TestCase__Utility_GetMilliseconds", TestCase__Utility_GetMilliseconds)
this.addTest("TestCase__Utility_Backoff", TestCase__Utility_Backoff)
this.addTest("TestCase__Utility_StripHTTPProtocol", TestCase__Utility_StripHTTPProtocol)
this.addTest("TestCase__Utility_ExtractUriParts", TestCase__Utility_ExtractUriParts)
this.addTest("TestCase__Utility_RandomBytes", TestCase__Utility_RandomBytes)
this.addTest("TestCase__Utility_UnsignedIntegerToLittleEndian", TestCase__Utility_UnsignedIntegerToLittleEndian)
Expand Down