Skip to content

Replace tagdb_key_t with GList* #39

Description

@mwatts15

Some of the ways that tagdb_key_t is used would be better handled with a GList* type. For instance, key_push_end and key_pop_front require replicating the key before passing in if the original key is meant to be left unmodified by the receiving function where this operation is a simple change in pointers (i.e., next pointer, and append operations) for GList*, a linked-list type in glib.

The GArray type that the current tagdb_key_t is based on was chosen because it is possible to transparently resort the key passed in to procedures without needing to change the pointer passed in by callers. There is no longer a need to do this re-sorting. The Stage, trie, TagDB FileCabinet, File components all use the tagdb_key_t type. However, these do not need to be modified for correctness and can be modified after the fact to remove unnecessary copy operations (about 3 of them).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions