make variable naming consistent across library#223
Merged
Conversation
added 3 commits
July 6, 2026 10:30
# Conflicts: # library/data_structures_[l,r)/uncommon/priority_queue_of_updates.hpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purely cosmetic pass to make variable naming consistent across the library — code and doc comments (
@codeexamples,@paramdocs, READMEs were audited too). No functional or algorithmic changes; opts for the shorter form wherever two conventions coexisted.Conventions enforced
resret,ans,tmp_rescurcurrvisseen,usednxtnext(member arrays in tries; also avoids shadowingstd::next)valelempriprioritycnt_*count_*,left_count->cnt_lpos/pos_idxindex/index_into_indexAlready-consistent names (
tin,siz,dp,idx,tl/tr/tm,l/r,u/v/w) were left as the established standard.Code changes (15 files)
data_structures_[l,r)/bit.hpp,data_structures_[l,r]/bit.hpp—ret->resdata_structures_[l,r)/bit_uncommon/kd_bit.hpp—ans->resdata_structures_[l,r)/seg_tree_uncommon/kth_smallest_query.hpp—left_count->cnt_ldata_structures_[l,r)/uncommon/deque_op.hpp—elem->valdata_structures_[l,r)/uncommon/mode_query.hpp—index/index_into_index->pos/pos_idxdata_structures_[l,r)/uncommon/priority_queue_of_updates.hpp—curr->cur,priorityparam ->pri(in code,@param, and@codeexample)flow/hungarian.hpp—used->visgraphs/uncommon/enumerate_triangles.hpp—seen->vismath/count_paths/count_paths_rectangle.hpp—ret/res/tmp_res->res/cur/tmpmath/num_distinct_subsequences.hpp—curr->curstrings/trie.hpp,strings/binary_trie.hpp—nextmember ->nxttests/.../binary_trie.test.cpp— updated for thenxtmember renameDoc-comment changes
graphs/bcc_callback.hpp—@codeexample:seen/count_edges->vis/cnt_edgesdsu/line_tree.hpp—@codeexample:next->nxtpriority_queue_of_updates.hpp—@code/@param:curr_pri/priority->pri(example was also rewritten upstream in fix doc nits #220; kept the new version withpri)Full sweep of all
@code...@endcodeblocks and repo READMEs confirms no remaining occurrences of the replaced names.Verification
clang-format --dry-run --Werrorpasses withdev.clang-formaton all changed filesg++ -std=c++20 -O2 -Wall -Wextradev(includes fix doc nits #220 doc nits and pass recursive lambda self param by reference #222 recursive-lambda change); the one conflict (priority_queue_of_updates.hppdoc example) resolved in favor of dev's rewritten example with theprinaming applied