Skip to content

Commit

Permalink
switch to using split instead of tokenize for speed improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
triwav committed Mar 27, 2024
1 parent 480bbf6 commit b9b3a1e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion device/components/RTA_OnDeviceComponent.brs
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ function processSetValueRequest(request as Object) as Object
end if
else
' Have to walk up the tree until we get to a node as anything that is a field on a node must be replaced
nodeParentKeyPathParts = keyPath.tokenize(".").toArray()
nodeParentKeyPathParts = keyPath.split(".")
setKeyPathParts = []

while NOT nodeParentKeyPathParts.isEmpty()
Expand Down
6 changes: 3 additions & 3 deletions device/components/RTA_helpers.brs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ function RTA_callBrightscriptInterfaceFunction(keyPathPart as string, callOn as
return Invalid
end if
numCharacters = closingParenthesisPosition - (openingParenthesisPosition + 2)
functionParams = mid(keyPathPart, openingParenthesisPosition + 2, numCharacters).tokenize(",")
functionParams = mid(keyPathPart, openingParenthesisPosition + 2, numCharacters).split(",")

if functionName = "getParent" then
if RTA_isNode(callOn) then
Expand Down Expand Up @@ -426,7 +426,7 @@ function RTA_getValueAtKeyPath(base as Object, keyPath as String, fallback = Inv
if NOT RTA_isKeyedValueType(base) AND NOT RTA_isNonEmptyArray(base) then return fallback
if keyPath = "" then return base

keys = keyPath.tokenize(".")
keys = keyPath.split(".")
level = base

while NOT keys.isEmpty()
Expand Down Expand Up @@ -551,7 +551,7 @@ function RTA_setValueAtKeyPath(base as Object, keyPath as String, value as Dynam
' We only allow setting on an AA or array as those are the only ones that should need this functionality
if NOT RTA_isAA(base) AND NOT RTA_isArray(base) then return false

keys = keyPath.tokenize(".")
keys = keyPath.split(".")
level = base
nextLevelNeedsToBeCreated = false
previousKeyOrIndex = ""
Expand Down

0 comments on commit b9b3a1e

Please sign in to comment.