Skip to content

range for array is incorrect #1

@tisdav

Description

@tisdav

Hi Zakaria1193,

in

for j in range(field_type.range()[1]):

the use of the range operator is incorrect, yielding to len(array)-1 length arrays in the dict.
e.g consider

  • "field_value" to be an gdb array of length 10 of int16_t-s
  • then "field_type" will be <gdb.Type code=TYPE_CODE_ARRAY name=int16_t [10]>
  • then "field_type.range()" will be (0,9)
  • consequently "for j in range(field_type.range()[1]):" will iterate through [0..9) or [0..8]inclusive leaving element at index "9" out of the "append_gdb_value_to_list"

the correct range is:
for j in range(field_type.range()[1]+1):

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions