Skip to content

Conversation

Copy link

Copilot AI commented Nov 22, 2025

  • What does this PR do?

Replaces the AliasList data structure (based on TAILQ_HEAD linked list) with AliasArray (based on ARRAY_HEAD dynamic array) throughout the alias module. This modernizes the alias storage mechanism to use array-based data structures instead of linked lists.

Key changes:

  • Removed TAILQ_ENTRY(Alias) from struct Alias
  • Defined AliasArray using ARRAY_HEAD(AliasArray, struct Alias *)
  • Updated global Aliases variable to use AliasArray
  • Converted all TAILQ operations to ARRAY operations:
    • TAILQ_FOREACHARRAY_FOREACH
    • TAILQ_INSERT_TAILARRAY_ADD
    • TAILQ_REMOVEARRAY_REMOVE
    • TAILQ_HEAD_INITIALIZERARRAY_HEAD_INITIALIZER
    • TAILQ_EMPTYARRAY_EMPTY
  • Updated aliaslist_clear() to work with AliasArray
  • Updated function signatures in functions.h and gui.h
  • Modified all usage in alias.c, commands.c, dlg_alias.c, dlg_query.c, and functions.c
  • Renamed all AliasArray variables from al to aa for consistency and clarity
  • Screenshots (if relevant)

N/A - Internal data structure change with no UI impact

  • Does this PR meet the acceptance criteria?

    • Documentation created/updated - N/A (internal implementation change)
    • All builds and tests are passing - ✅ Build completes successfully
    • Added doxygen code documentation - ✅ Updated function documentation
    • Code follows the style guide - ✅
  • What are the relevant issue numbers?

N/A

Original prompt

AliasList is based on TAILQ_HEAD. Replace it with AliasArray based on ARRAY_HEAD.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@flatcap
Copy link
Member

flatcap commented Nov 22, 2025

@copilot try again

Copy link
Author

Copilot AI commented Nov 22, 2025

@copilot try again

Done! I've successfully replaced AliasList (TAILQ_HEAD) with AliasArray (ARRAY_HEAD) in commit 220bab2.

The changes include:

  • Removed TAILQ_ENTRY from struct Alias
  • Defined AliasArray using ARRAY_HEAD
  • Converted all TAILQ operations to ARRAY operations across alias.c, commands.c, dlg_alias.c, dlg_query.c, and functions.c
  • Updated function signatures and struct members
  • Successfully built the project

Copilot AI changed the title [WIP] Replace AliasList with AliasArray using ARRAY_HEAD Replace AliasList with AliasArray using ARRAY_HEAD Nov 22, 2025
@flatcap
Copy link
Member

flatcap commented Nov 22, 2025

@copilot rename AliasArray variables from al to aa

Copy link
Author

Copilot AI commented Nov 22, 2025

@copilot rename AliasArray variables from al to aa

Renamed all AliasArray variables from al to aa in commit 2ef6693. Changes include:

  • Function parameters in alias.h, functions.h
  • Struct member AliasMenuData.aa in gui.h
  • Local variables in alias.c, dlg_query.c, functions.c
    Build verified successfully.

@flatcap flatcap force-pushed the copilot/replace-aliaslist-with-aliasarray branch from 2ef6693 to c0bef7c Compare December 11, 2025 23:53
@flatcap flatcap force-pushed the copilot/replace-aliaslist-with-aliasarray branch from c0bef7c to c5981e3 Compare December 22, 2025 11:16
@flatcap flatcap added the topic:refactoring Code refactoring label Jan 3, 2026
@flatcap flatcap marked this pull request as ready for review January 3, 2026 12:23
@flatcap flatcap force-pushed the copilot/replace-aliaslist-with-aliasarray branch from c5981e3 to 3958b85 Compare January 3, 2026 12:25
- Remove TAILQ_ENTRY from struct Alias
- Define AliasArray using ARRAY_HEAD(AliasArray, struct Alias *)
- Update global Aliases variable to use AliasArray
- Replace all TAILQ operations with ARRAY operations:
  - TAILQ_FOREACH → ARRAY_FOREACH
  - TAILQ_INSERT_TAIL → ARRAY_ADD
  - TAILQ_REMOVE → ARRAY_REMOVE
  - TAILQ_HEAD_INITIALIZER → ARRAY_HEAD_INITIALIZER
  - TAILQ_EMPTY → ARRAY_EMPTY
- Update aliaslist_clear() to work with AliasArray
- Update function signatures in functions.h and gui.h
- Update all usage in alias.c, commands.c, dlg_alias.c, dlg_query.c, and functions.c

Assisted-by: GitHub Copilot
@flatcap flatcap force-pushed the copilot/replace-aliaslist-with-aliasarray branch from 3958b85 to 99137c1 Compare January 4, 2026 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic:refactoring Code refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants