NASA-AMMOS / NASA-AMMOS/BSL

Many index-based walking of linked lists

Open
#37 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue
Dominant language
C
Stars
14
Forks
9
Avg merge
2d 12h
Merged PRs (30d)
33

Description

There are many cases of walking linked lists using index iteration, which will be exponentially slower than using list iterators.

Replacing these is simple, such as replacing the slow strategy

        for (size_t target_index = 0; target_index < uint64_list_size(self->targets); target_index++)
        {
            QCBOREncode_AddUInt64(&encoder, *uint64_list_get(self->targets, target_index));
        }

with the iterator strategy

        uint64_list_it_t it;
        for (uint64_list_it(it, self->targets); !uint64_list_end_p(it); uint64_list_next(it))
        {
            QCBOREncode_AddUInt64(&encoder, *uint64_list_cref(it));
        }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the repository for linked-list loops using size and index-based access, then compare each case with the uint64_list iterator example in the issue. Replace the applicable walking patterns and verify that all relevant cases use iterators without breaking the project’s existing checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
performance
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.