INNER CODE UNIT · Python
find_element
cadaver/turso3d · ThirdParty/SDL/src/joystick/sort_controllers.py:29
def find_element(prefix, bindings):
i=0
for element in bindings:
if element.startswith(prefix):
return i
i=(i + 1)
return -1
def get_crc_from_entry(entry):
crc = ""
line = "".join(entry)
bindings = line.split(",")
pos = find_element("crc:", bindings)
if pos >= 0:
crc = bindings[pos][4:]
return crc