-
-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix warnings in build process #1470
Conversation
Fixed warnings in Linux / Clang. Fixed warnings in Win cross-compile. no-gui build only.
WalkthroughThe changes encompass extensive updates to the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
src/immer/experimental/dvektor.hpp (1)
Missing Implementations and Tests for
dvektor
Member FunctionsThe member functions
push_back
,assoc
, andupdate
in thedvektor
class are not found in the codebase. Additionally, there are no corresponding test cases for these functions.
- Ensure that the member functions
push_back
,assoc
, andupdate
are implemented in thedvektor
class.- Add test cases for these functions to verify their functionality.
Analysis chain
Line range hint
25-67
:
Changes todvektor
class improve functionality.The added type aliases, iterators, and member functions enhance the functionality and usability of the
dvektor
class.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the implementation and tests of the new member functions in `dvektor` class. # Test: Search for the implementation of the new member functions. Expect: Correct implementation in the included headers. rg --type cpp --pattern $'dvektor::push_back' rg --type cpp --pattern $'dvektor::assoc' rg --type cpp --pattern $'dvektor::update' # Test: Search for the tests of the new member functions. Expect: Test cases in the test files. rg --type cpp --pattern $'dvektor::push_back' --files-with-matches | xargs -I {} rg --type cpp --pattern $'TEST' {} rg --type cpp --pattern $'dvektor::assoc' --files-with-matches | xargs -I {} rg --type cpp --pattern $'TEST' {} rg --type cpp --pattern $'dvektor::update' --files-with-matches | xargs -I {} rg --type cpp --pattern $'TEST' {}Length of output: 2940
Script:
#!/bin/bash # Description: Verify the implementation and tests of the new member functions in `dvektor` class. # Test: Search for the implementation of the new member functions. Expect: Correct implementation in the included headers. rg --type cpp 'dvektor::push_back' rg --type cpp 'dvektor::assoc' rg --type cpp 'dvektor::update' # Test: Search for the tests of the new member functions. Expect: Test cases in the test files. rg --type cpp 'dvektor::push_back' --files-with-matches | xargs -I {} rg --type cpp 'TEST' {} rg --type cpp 'dvektor::assoc' --files-with-matches | xargs -I {} rg --type cpp 'TEST' {} rg --type cpp 'dvektor::update' --files-with-matches | xargs -I {} rg --type cpp 'TEST' {}Length of output: 378
Script:
#!/bin/bash # Description: Verify the implementation and tests of the new member functions in `dvektor` class. # Search for the `dvektor` class definition to ensure we are looking at the right files. rg --type cpp 'class dvektor' # Search for the implementation of the new member functions in the `dvektor` class. rg --type cpp 'dvektor::push_back' rg --type cpp 'dvektor::assoc' rg --type cpp 'dvektor::update' # Search for the tests of the new member functions in the `dvektor` class. rg --type cpp 'dvektor::push_back' --files-with-matches | xargs -I {} rg --type cpp 'TEST' {} rg --type cpp 'dvektor::assoc' --files-with-matches | xargs -I {} rg --type cpp 'TEST' {} rg --type cpp 'dvektor::update' --files-with-matches | xargs -I {} rg --type cpp 'TEST' {}Length of output: 459
Script:
#!/bin/bash # Description: Verify the implementation and tests of the new member functions in `dvektor` class. # Search for the `dvektor` class definition to ensure we are looking at the right files. rg --type cpp 'class dvektor' # Search for the implementation of the new member functions in the `dvektor` class. rg --type cpp 'dvektor::push_back' rg --type cpp 'dvektor::assoc' rg --type cpp 'dvektor::update' # Search for the tests of the new member functions in the `dvektor` class. rg --type cpp 'push_back' --files-with-matches | xargs -I {} rg --type cpp 'TEST' {} rg --type cpp 'assoc' --files-with-matches | xargs -I {} rg --type cpp 'TEST' {} rg --type cpp 'update' --files-with-matches | xargs -I {} rg --type cpp 'TEST' {}Length of output: 56225
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (56)
- src/Makefile.am (1 hunks)
- src/compat/glibcxx_sanity.cpp (1 hunks)
- src/immer/algorithm.hpp (11 hunks)
- src/immer/array.hpp (9 hunks)
- src/immer/array_transient.hpp (6 hunks)
- src/immer/atom.hpp (8 hunks)
- src/immer/box.hpp (6 hunks)
- src/immer/config.hpp (3 hunks)
- src/immer/detail/arrays/no_capacity.hpp (4 hunks)
- src/immer/detail/arrays/node.hpp (3 hunks)
- src/immer/detail/arrays/with_capacity.hpp (10 hunks)
- src/immer/detail/combine_standard_layout.hpp (8 hunks)
- src/immer/detail/hamts/bits.hpp (5 hunks)
- src/immer/detail/hamts/champ.hpp (10 hunks)
- src/immer/detail/hamts/champ_iterator.hpp (6 hunks)
- src/immer/detail/hamts/node.hpp (13 hunks)
- src/immer/detail/iterator_facade.hpp (5 hunks)
- src/immer/detail/rbts/bits.hpp (2 hunks)
- src/immer/detail/rbts/node.hpp (23 hunks)
- src/immer/detail/rbts/position.hpp (50 hunks)
- src/immer/detail/rbts/rbtree.hpp (16 hunks)
- src/immer/detail/rbts/rbtree_iterator.hpp (4 hunks)
- src/immer/detail/rbts/rrbtree.hpp (27 hunks)
- src/immer/detail/rbts/rrbtree_iterator.hpp (3 hunks)
- src/immer/detail/rbts/visitor.hpp (1 hunks)
- src/immer/detail/ref_count_base.hpp (1 hunks)
- src/immer/detail/type_traits.hpp (2 hunks)
- src/immer/detail/util.hpp (5 hunks)
- src/immer/experimental/detail/dvektor_impl.hpp (18 hunks)
- src/immer/experimental/dvektor.hpp (2 hunks)
- src/immer/flex_vector.hpp (15 hunks)
- src/immer/flex_vector_transient.hpp (7 hunks)
- src/immer/heap/cpp_heap.hpp (2 hunks)
- src/immer/heap/debug_size_heap.hpp (2 hunks)
- src/immer/heap/free_list_heap.hpp (1 hunks)
- src/immer/heap/free_list_node.hpp (1 hunks)
- src/immer/heap/gc_heap.hpp (4 hunks)
- src/immer/heap/heap_policy.hpp (6 hunks)
- src/immer/heap/malloc_heap.hpp (3 hunks)
- src/immer/heap/split_heap.hpp (2 hunks)
- src/immer/heap/tags.hpp (1 hunks)
- src/immer/heap/thread_local_free_list_heap.hpp (2 hunks)
- src/immer/heap/unsafe_free_list_heap.hpp (5 hunks)
- src/immer/lock/no_lock_policy.hpp (1 hunks)
- src/immer/lock/spinlock_policy.hpp (1 hunks)
- src/immer/map.hpp (8 hunks)
- src/immer/map_transient.hpp (1 hunks)
- src/immer/memory_policy.hpp (8 hunks)
- src/immer/refcount/no_refcount_policy.hpp (1 hunks)
- src/immer/refcount/refcount_policy.hpp (1 hunks)
- src/immer/refcount/unsafe_refcount_policy.hpp (1 hunks)
- src/immer/set.hpp (3 hunks)
- src/immer/set_transient.hpp (1 hunks)
- src/immer/table.hpp (1 hunks)
- src/immer/table_transient.hpp (1 hunks)
- src/immer/transience/gc_transience_policy.hpp (5 hunks)
Files not processed due to max files limit (13)
- src/immer/transience/no_transience_policy.hpp
- src/immer/vector.hpp
- src/immer/vector_transient.hpp
- src/libspark/bpplus.cpp
- src/rpc/net.cpp
- src/rpc/protocol.cpp
- src/script/ismine.cpp
- src/secp256k1/src/ecmult.h
- src/secp256k1/src/ecmult_const_impl.h
- src/secp256k1/src/ecmult_impl.h
- src/secp256k1/src/scratch_impl.h
- src/util.cpp
- src/wallet/wallet.cpp
Files not summarized due to errors (4)
- src/immer/detail/hamts/champ.hpp: Error: Message exceeds token limit
- src/immer/detail/hamts/node.hpp: Error: Message exceeds token limit
- src/immer/detail/rbts/position.hpp: Error: Message exceeds token limit
- src/immer/detail/rbts/rrbtree.hpp: Error: Message exceeds token limit
Files skipped from review due to trivial changes (12)
- src/compat/glibcxx_sanity.cpp
- src/immer/detail/rbts/bits.hpp
- src/immer/detail/rbts/rrbtree_iterator.hpp
- src/immer/detail/ref_count_base.hpp
- src/immer/detail/type_traits.hpp
- src/immer/heap/free_list_heap.hpp
- src/immer/heap/free_list_node.hpp
- src/immer/heap/heap_policy.hpp
- src/immer/heap/split_heap.hpp
- src/immer/heap/tags.hpp
- src/immer/heap/thread_local_free_list_heap.hpp
- src/immer/refcount/no_refcount_policy.hpp
Additional comments not posted (241)
src/immer/lock/no_lock_policy.hpp (1)
1-25
: LGTM!The changes in this file are straightforward and don't introduce any issues.
src/immer/refcount/unsafe_refcount_policy.hpp (1)
26-30
: LGTM!The changes in this file are straightforward and don't introduce any issues.
src/immer/refcount/refcount_policy.hpp (1)
27-31
: LGTM!The changes in this file are straightforward and don't introduce any issues.
src/immer/heap/cpp_heap.hpp (1)
36-38
: LGTM!The changes in this file are straightforward and don't introduce any issues.
src/immer/heap/malloc_heap.hpp (4)
13-13
: Include<cassert>
is appropriate.The addition of
<cassert>
is necessary for using assertions.
15-15
: Include<exception>
is appropriate.The addition of
<exception>
is necessary for using standard exception classes likestd::bad_alloc
.
16-16
: Include<memory>
is appropriate.The addition of
<memory>
is necessary for using memory management utilities.
34-34
: Improved performance and exception handling inallocate
function.The use of
IMMER_UNLIKELY
andIMMER_THROW
enhances performance and exception handling.Verification successful
Improved performance and exception handling in
allocate
function.The use of
IMMER_UNLIKELY
andIMMER_THROW
enhances performance and exception handling. The macros are correctly defined insrc/immer/config.hpp
.
IMMER_UNLIKELY(cond)
is defined as__builtin_expect(!!(cond), 0)
.IMMER_THROW(expr)
is defined asthrow expr
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the definition of IMMER_UNLIKELY and IMMER_THROW macros. # Test: Search for the definition of the macros. Expect: Definitions in the included headers. rg --type cpp --pattern $'#define IMMER_UNLIKELY' rg --type cpp --pattern $'#define IMMER_THROW'Length of output: 922
Script:
#!/bin/bash # Description: Verify the definition of IMMER_UNLIKELY and IMMER_THROW macros. # Test: Search for the definition of the macros. Expect: Definitions in the included headers. rg '#define IMMER_UNLIKELY' rg '#define IMMER_THROW'Length of output: 351
src/immer/detail/rbts/visitor.hpp (1)
24-24
: Use ofIMMER_UNREACHABLE
invisit_node
function is appropriate.The use of
IMMER_UNREACHABLE
is suitable for indicating unreachable code.Verification successful
Use of
IMMER_UNREACHABLE
invisit_node
function is appropriate.The
IMMER_UNREACHABLE
macro is correctly defined insrc/immer/config.hpp
and is suitable for indicating unreachable code.
src/immer/config.hpp
:#define IMMER_UNREACHABLE __assume(false)
src/immer/config.hpp
:#define IMMER_UNREACHABLE __builtin_unreachable()
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the definition of IMMER_UNREACHABLE macro. # Test: Search for the definition of the macro. Expect: Definition in the included headers. rg --type cpp --pattern $'#define IMMER_UNREACHABLE'Length of output: 465
Script:
#!/bin/bash # Description: Verify the definition of IMMER_UNREACHABLE macro. # Test: Search for the definition of the macro. Expect: Definition in the included headers. rg '#define IMMER_UNREACHABLE'Length of output: 166
src/immer/lock/spinlock_policy.hpp (5)
1-8
: License header is appropriate.The addition of the license header is necessary for legal compliance.
11-11
: Include<atomic>
is appropriate.The addition of
<atomic>
is necessary for using atomic operations.
12-12
: Include<thread>
is appropriate.The addition of
<thread>
is necessary for using thread operations.
15-21
: Macro definitions forIMMER_SMT_PAUSE
are appropriate.The addition of these macros is necessary for handling different compiler and architecture-specific pause instructions.
28-66
: Implementation ofspinlock_policy
is appropriate.The
spinlock_policy
struct provides a lightweight locking mechanism using atomic operations.src/immer/experimental/dvektor.hpp (1)
15-15
: Include<cstddef>
is appropriate.The addition of
<cstddef>
is necessary for using size-related types.src/immer/heap/debug_size_heap.hpp (4)
14-17
: LGTM! Necessary headers added.The added headers
<cassert>
,<cstddef>
,<type_traits>
, and<memory>
are appropriate and necessary for the functionality provided in this file.
30-43
: Conditional Compilation for MinGW 32-bit: ApprovedThe conditional compilation block addresses a known bug in MinGW 32-bit regarding
std::max_align_t
. The logic is sound and correctly implemented.
48-50
: LGTM! Allocation logic is correct.The
allocate
function correctly includes theextra_size
in the allocation size and stores the original size at the beginning of the allocated memory.
Line range hint
52-55
:
LGTM! Deallocation logic is correct.The
deallocate
function correctly retrieves the original size from the allocated memory and asserts that it matches the size passed to the function.src/immer/detail/rbts/rbtree_iterator.hpp (6)
12-12
: LGTM! Necessary header added.The added header
<immer/detail/rbts/rbtree.hpp>
is appropriate and necessary for the functionality provided in this file.
29-30
: LGTM! Addition ofend_t
struct is correct.The addition of
end_t
struct withinrbtree_iterator
is logical and correctly implemented.
35-45
: LGTM! Constructor changes are correct.The constructors of
rbtree_iterator
correctly initialize the member variables.
54-56
: LGTM! Member variable changes are correct.The changes in the member variables of
rbtree_iterator
are logical and correctly implemented.
78-78
: LGTM!equal
function is correct.The
equal
function correctly compares tworbtree_iterator
instances.
82-83
: LGTM!distance_to
function is correct.The
distance_to
function correctly calculates the distance between tworbtree_iterator
instances.src/immer/transience/gc_transience_policy.hpp (5)
13-13
: LGTM! Necessary headers added.The added headers
<atomic>
,<memory>
, and<utility>
are appropriate and necessary for the functionality provided in this file.
43-45
: LGTM! Changes inedit
struct are correct.The changes in the
edit
struct, including the constructor and comparison operators, are logical and correctly implemented.
Line range hint
60-66
:
LGTM! Changes inowner
struct are correct.The changes in the
owner
struct, including themake_token_
function and modifications in constructors and assignment operators, are logical and correctly implemented.
88-88
: LGTM! Changes inownee
struct are correct.The changes in the
ownee
struct, including thetoken_
member variable and modifications in methods, are logical and correctly implemented.
111-111
: LGTM! Addition ofnoone
static member variable is correct.The addition of
noone
static member variable to thegc_transience_policy
struct is logical and correctly implemented.src/immer/heap/unsafe_free_list_heap.hpp (4)
13-15
: LGTM! Necessary headers added.The added headers
<cassert>
and<cstddef>
are appropriate and necessary for the functionality provided in this file.
31-31
: LGTM! Initialization ofstatic head_t
is correct.The initialization of
static head_t
within thehead
function is logical and correctly implemented.
72-73
: LGTM! Deallocation logic is correct.The
deallocate
function correctly handles the free list and base deallocation.
83-84
: LGTM! Clear function logic is correct.The
clear
function correctly deallocates all nodes in the free list.src/immer/heap/gc_heap.hpp (4)
20-22
: Includes for<cassert>
,<cstdlib>
, and<exception>
are necessary.These includes are required for assertions, memory allocation, and exception handling.
Line range hint
27-63
:
Garbage collection initialization macros and code are necessary.These changes ensure that garbage collection is initialized if required.
Line range hint
110-119
:
Exception handling for memory allocation failures is necessary.These changes ensure that exceptions are properly thrown if memory allocation fails.
123-126
: Deallocate method is necessary.This method ensures that memory is properly deallocated.
src/immer/config.hpp (7)
11-13
: C++17 detection macro is necessary.This change ensures that the code can conditionally use C++17 features if available.
15-23
:nodiscard
attribute detection macro is necessary.This change ensures that functions marked with
nodiscard
will generate a warning if the return value is ignored.
25-29
: Exception handling detection macro is necessary.This change ensures that the code can conditionally handle the absence of exceptions.
31-45
: Exception handling macros are necessary.These changes ensure that exception handling can be conditionally compiled based on the presence of exceptions.
47-49
:nodiscard
macro definition is necessary.This change ensures that the
nodiscard
attribute is always available.
51-63
: Tagged node debugging macros are necessary.These changes ensure that tagged node debugging can be conditionally enabled or disabled.
Line range hint
64-122
:
Debugging and optimization macros are necessary.These changes ensure that debugging and optimization features can be conditionally enabled or disabled.
src/immer/detail/arrays/node.hpp (7)
11-16
: Includes for<immer/config.hpp>
and<cstddef>
are necessary.These includes are required for configuration settings and size-related operations.
26-59
: Updates to thenode
structure are necessary.These changes improve the functionality and readability of the
node
structure.
64-64
: Updates to thedelete_n
method are necessary.These changes ensure that memory is properly destroyed and deallocated.
69-75
: Updates to themake_n
andmake_e
methods are necessary.These changes ensure that memory is properly allocated.
83-89
: Updates to thefill_n
method are necessary.These changes ensure that memory is properly initialized and exceptions are handled.
93-106
: Updates to thecopy_n
method are necessary.These changes ensure that memory is properly copied and exceptions are handled.
Line range hint
118-122
:
Updates to thecopy_e
method are necessary.These changes ensure that memory is properly copied and exceptions are handled.
src/immer/detail/hamts/champ_iterator.hpp (5)
Line range hint
32-59
:
Updates to thechamp_iterator
structure are necessary.These changes improve the functionality and readability of the
champ_iterator
structure.
72-72
: Update to theincrement
method is necessary.This change ensures that the iterator remains valid after incrementing.
84-95
: Updates to thestep_down
method are necessary.These changes ensure that the iterator can step down correctly.
109-118
: Updates to thestep_right
method are necessary.These changes ensure that the iterator can step right correctly.
Line range hint
131-146
:
Updates to theensure_valid_
method are necessary.These changes ensure that the iterator remains valid.
src/immer/detail/hamts/bits.hpp (7)
11-11
: Include directive for<cstddef>
is necessary.The inclusion of
<cstddef>
is required for the use ofstd::size_t
.
22-26
: Type alias definitions improve readability and maintainability.The type aliases
size_t
,hash_t
,bits_t
,count_t
, andshift_t
provide meaningful names for commonly used types.
Line range hint
31-51
:
Template structget_bitmap_type
and its specializations are well-implemented.The template struct and its specializations provide a mechanism to select an appropriate bitmap type based on the value of
B
.
53-63
: Template constants provide compile-time calculations.The
branches
,mask
,max_depth
, andmax_shift
template constants enable compile-time calculations for various parameters based on the value ofB
.
82-83
: Fallback implementation forpopcount
onstd::uint64_t
.The
popcount_fallback
function provides a fallback implementation for counting the number of set bits in a 64-bit integer.
102-112
: Platform-specific implementation forpopcount
onstd::uint64_t
.The
popcount
function provides a platform-specific implementation for counting the number of set bits in a 64-bit integer, with a fallback to thepopcount_fallback
function.
128-171
: Class templateset_bits_range
provides an iterator-based interface.The
set_bits_range
class template introduces an iterator-based interface for iterating over set bits in a bitmap, enhancing code readability and usability.src/immer/memory_policy.hpp (7)
13-14
: Include directives forno_lock_policy.hpp
andspinlock_policy.hpp
are necessary.The inclusion of
no_lock_policy.hpp
andspinlock_policy.hpp
is required for the use ofno_lock_policy
andspinlock_policy
in the file.
30-32
: Metafunctionget_transience_policy
selects the appropriate transience policy.The
get_transience_policy
metafunction selects the appropriate transience policy based on the provided refcount policy.
44-46
: Metafunctionget_prefer_fewer_bigger_objects
determines preference for fewer bigger objects.The
get_prefer_fewer_bigger_objects
metafunction determines whether to prefer fewer bigger objects based on the provided heap policy.
59-61
: Metafunctionget_use_transient_rvalues
determines whether to use transient R-values.The
get_use_transient_rvalues
metafunction determines whether to use transient R-values based on the provided refcount policy.
88-104
: Structmemory_policy
encapsulates various memory management policies and flags.The
memory_policy
struct encapsulates various memory management policies and flags, providing a flexible and configurable memory policy.
129-132
: Default lock policy is set based on thread safety configuration.The default lock policy is set to
no_lock_policy
if thread safety is disabled, otherwise tospinlock_policy
.
138-140
: Default memory policy is configured with appropriate default policies.The default memory policy is set using the
memory_policy
struct with default policies for heap, refcount, and lock.src/immer/detail/combine_standard_layout.hpp (7)
11-12
: Includes added for necessary utilities.The includes for
<cstddef>
and<type_traits>
are necessary forstd::size_t
and type traits utilities used in the file.
14-19
: Macros added for GCC 7.1 standard layout detection issue.The macros handle a known issue with standard layout detection in GCC 7.1 by providing a workaround.
52-53
: Type wrapper struct added.The
type_t
struct template is a simple wrapper for a type, used for type-based dispatch in theget
functions.
61-79
: Struct template for inheriting types added and modified.The
inherit
struct template combines standard layout types while preserving empty base optimizations and supports type-based dispatch.
Line range hint
107-125
:
Struct template for member types added and modified.The
member
struct template combines standard layout types by adding them as members and supports type-based dispatch.
164-186
: Struct template for combining two types added.The
member_two
struct template combines two standard layout types, one as a member and the other as a nested member, and supports type-based dispatch.
Line range hint
198-219
:
Struct template for combining multiple types added and modified.The
combine_standard_layout_aux
struct template combines multiple standard layout types while preserving empty base optimizations and standard layout rules.src/immer/array_transient.hpp (3)
12-14
: Includes added for necessary utilities.The includes for
<cstddef>
and<immer/memory_policy.hpp>
are necessary forstd::size_t
and memory policy utilities used in the file.
64-96
: Attributes added to prevent discarding return values.The
IMMER_NODISCARD
attribute ensures that the return value of these functions is not ignored, which is important for correctness.Also applies to: 102-107, 117-122, 130-138, 184-191
109-112
: Member function added for mutable data access.The
data_mut()
member function provides mutable access to the underlying data, which is necessary for modifying it in a controlled manner.src/immer/set_transient.hpp (3)
12-12
: Includes added for necessary utilities.The include for
<immer/memory_policy.hpp>
is necessary for memory policy utilities used in the file.
63-84
: Attributes added to prevent discarding return values.The
IMMER_NODISCARD
attribute ensures that the return value of these functions is not ignored, which is important for correctness.Also applies to: 94-102, 108-112, 120-124, 135-142, 162-167
149-150
: Member functions modified for better readability and consistency.The modifications improve the readability and consistency of the code, making it easier to understand and maintain.
Also applies to: 156-157, 164-167
src/immer/box.hpp (3)
14-15
: Includes added for necessary utilities.The include for
<cstddef>
is necessary forstd::size_t
used in the file.
125-125
: Attributes added to prevent discarding return values.The
IMMER_NODISCARD
attribute ensures that the return value of these functions is not ignored, which is important for correctness.Also applies to: 131-134, 152-157, 167-225
167-225
: Comparison operators forbox
instances added.The comparison operators allow for comparing
box
instances, which is useful for various operations and improves usability.src/immer/atom.hpp (6)
24-28
: LGTM!The renaming and reorganization of types and variables within
refcount_atom_impl
improve readability and consistency.
57-57
: LGTM!The use of
scoped_lock_t
in theexchange
method ensures thread safety.
70-70
: LGTM!The use of
scoped_lock_t
in theupdate
method ensures thread safety.
84-90
: LGTM!The renaming and reorganization of types and variables within
gc_atom_impl
improve readability and consistency. The use ofstatic_assert
ensures correct usage.
105-105
: LGTM!The changes in the
exchange
method ensure consistency with the rest of the class.
148-148
: LGTM!The addition of the
IMMER_NODISCARD
attribute ensures that the return value of theatom
class functions is not ignored.src/immer/flex_vector_transient.hpp (7)
91-91
: LGTM!The addition of the
IMMER_NODISCARD
attribute ensures that the return value of thebegin
function is not ignored.
97-100
: LGTM!The addition of the
IMMER_NODISCARD
attribute ensures that the return value of theend
function is not ignored.
107-110
: LGTM!The addition of the
IMMER_NODISCARD
attribute ensures that the return value of therbegin
function is not ignored.
117-120
: LGTM!The addition of the
IMMER_NODISCARD
attribute ensures that the return value of therend
function is not ignored.
126-126
: LGTM!The addition of the
IMMER_NODISCARD
attribute ensures that the return value of thesize
function is not ignored.
132-132
: LGTM!The addition of the
IMMER_NODISCARD
attribute ensures that the return value of theempty
function is not ignored.
231-236
: LGTM!The addition of the
IMMER_NODISCARD
attribute ensures that the return value of thepersistent
function is not ignored.src/immer/detail/arrays/with_capacity.hpp (6)
104-112
: LGTM!The addition of the
data_mut
method provides a mutable pointer to the data, ensuring thread safety withedit_t
.
124-135
: LGTM!The addition of the
from_range
method provides a way to create awith_capacity
object from a range of iterators. The use ofstd::enable_if_t
ensures correct usage.
147-147
: LGTM!The addition of the
from_fill
method provides a way to create awith_capacity
object by filling it with a specified value.
167-167
: LGTM!The use of the
IMMER_THROW
macro ensures consistent exception handling. The addition of bounds checking improves robustness.
201-205
: LGTM!The use of the
IMMER_TRY
,IMMER_CATCH
, andIMMER_RETHROW
macros ensures consistent exception handling, improving robustness.
262-269
: LGTM!The use of the
IMMER_TRY
,IMMER_CATCH
, andIMMER_RETHROW
macros ensures consistent exception handling, improving robustness.src/immer/detail/util.hpp (6)
27-38
: LGTM!The addition of the
as_const
method provides a way to obtain a const reference or pointer to a non-const object, ensuring const-correctness.
44-52
: LGTM!The addition of the
auto_const_cast
method provides a way to cast away constness from an object, useful in certain scenarios.
54-66
: LGTM!The addition of the
destroy_at
method provides a way to destroy an object at a given memory location, useful for custom memory management.
119-132
: LGTM!The use of the
IMMER_TRY
,IMMER_CATCH
, andIMMER_RETHROW
macros ensures consistent exception handling, improving robustness.
145-157
: LGTM!The use of the
IMMER_TRY
,IMMER_CATCH
, andIMMER_RETHROW
macros ensures consistent exception handling, improving robustness.
209-218
: LGTM!The addition of the
log2
method provides a way to compute the base-2 logarithm of a number. The use ofclz_
ensures platform optimization.src/immer/algorithm.hpp (7)
12-13
: Includes look good.The new includes
<cassert>
and<functional>
are appropriate for the added functionality.
52-53
: LGTM!The assertion and function call ensure that the iterators belong to the same container and the function object is forwarded correctly.
86-87
: LGTM!The assertion and function call ensure that the iterators belong to the same container and the function object is forwarded correctly.
96-112
: Efficient use of move semantics.The
accumulate_move
functions usestd::move
to efficiently accumulate values, which is beneficial for types that support move semantics.
122-132
: Efficient accumulation using move semantics.The
accumulate
function templates now usedetail::accumulate_move
, ensuring efficient accumulation using move semantics.Also applies to: 144-154
232-277
: Flexible difference handling.The
differ
struct template and related functions provide a flexible way to handle differences between containers.Also applies to: 306-321
306-321
: Efficient difference computation.The
diff
function template leverages structural sharing to offer efficient complexity for detecting changes.src/immer/set.hpp (2)
13-13
: Include looks good.The new include
<immer/memory_policy.hpp>
is appropriate for the added functionality.
65-67
: Improvements toset
class template.The changes include new type definitions, member functions, and improvements to existing functions. The additions and modifications are well-implemented and adhere to best practices.
Also applies to: 74-85, 96-113, 120-142, 151-158, 165-169, 177-181, 192-199, 204-211, 218-225, 232-239, 245-252, 260-260, 268-276, 278-278
src/immer/table_transient.hpp (2)
3-4
: Includes look good.The new includes
<immer/detail/hamts/champ.hpp>
and<immer/memory_policy.hpp>
are appropriate for the added functionality.
35-38
: Improvements totable_transient
class template.The changes include new type definitions, member functions, and improvements to existing functions. The additions and modifications are well-implemented and adhere to best practices.
Also applies to: 40-53, 58-59, 65-87, 96-114, 125-132, 140-144, 155-162, 170-174, 182-186, 197-204, 213-214, 220-227, 235-242, 248-248, 254-258, 264-264, 267-279
src/immer/array.hpp (2)
12-13
: Include looks good.The new include
<immer/memory_policy.hpp>
is appropriate for the added functionality.
45-48
: Improvements toarray
class template.The changes include new type definitions, member functions, and improvements to existing functions. The additions and modifications are well-implemented and adhere to best practices.
Also applies to: 54-133, 139-171, 179-191, 208-216, 234-242, 262-271, 289-297, 303-310, 318-318, 326-370
src/immer/map_transient.hpp (2)
12-12
: Include directive formemory_policy.hpp
added.This inclusion is necessary for the
MemoryPolicy
template parameter used in the class.
18-316
: Class templatemap_transient
defined with new template parameters and methods.The class template definition and methods align with the overall structure of the
immer
library.src/immer/experimental/detail/dvektor_impl.hpp (2)
20-20
: Include directive for<cstddef>
added.This inclusion is necessary for the use of
std::size_t
and other size-related types.
Line range hint
39-531
: Class templatenode
and related methods defined or refactored.The class template definition and methods align with the overall structure of the
immer
library.src/immer/detail/rbts/rbtree.hpp (2)
20-20
: Include directive for<stdexcept>
added.This inclusion is necessary for the use of standard exception handling classes.
Line range hint
26-531
: Class templaterbtree
and related methods defined or refactored.The class template definition and methods align with the overall structure of the
immer
library.src/immer/map.hpp (2)
18-18
: Include directive for<stdexcept>
added.This inclusion is necessary for the use of standard exception handling classes.
Line range hint
44-542
: Class templatemap
and related methods defined or refactored.The class template definition and methods align with the overall structure of the
immer
library.src/immer/table.hpp (2)
1-7
: LGTM! Necessary includes added.The added include directives are appropriate for the functionality of the
table
class and related structures.
241-243
: LGTM! Use ofIMMER_NODISCARD
is appropriate.The
IMMER_NODISCARD
attribute ensures that the return values of these functions are not ignored, which is a good practice.Also applies to: 247-249, 256-257, 262-263, 275-279, 286-290, 301-307, 315-318, 329-335, 343-346, 354-358, 372-374, 378-379, 395-397, 407-410, 419-423, 426-429, 438-440, 444-447, 455-456, 462-465, 471-474, 480-483
src/immer/flex_vector.hpp (1)
90-90
: LGTM! Use ofIMMER_NODISCARD
is appropriate.The
IMMER_NODISCARD
attribute ensures that the return values of these functions are not ignored, which is a good practice.Also applies to: 142-144, 148-151, 158-161, 168-171, 177-179, 183-185, 188-190, 193-195, 201-204, 212-214, 217-220, 222-224, 241-244, 246-249, 266-269, 288-291, 293-296, 318-321, 324-327, 345-348, 350-353, 371-374, 376-379, 397-401, 403-407, 409-413, 415-419, 437-440, 441-446, 449-452, 453-457, 462-465, 471-474, 503-504, 506-515, 541-544, 546-548, 551-554, 556-558, 562-565, 568-570, 573-576, 578-580, 583-586, 588-590, 593-597, 599-603, 605-609, 611-614
src/Makefile.am (1)
270-340
: LGTM! Necessary headers added.The added headers are appropriate for the functionality of the
lib immer
library.src/immer/detail/rbts/node.hpp (9)
11-15
: Approved: Inclusion of new headers.The added headers
<immer/config.hpp>
,<immer/detail/combine_standard_layout.hpp>
,<immer/detail/rbts/bits.hpp>
,<immer/detail/util.hpp>
, and<immer/heap/tags.hpp>
are relevant and necessary for the new functionality and refactored code.
Line range hint
26-52
:
Approved: Modifications tonode
struct template.The changes to the
node
struct template, including the addition of new member types and constants, and the introduction ofrelaxed_data_t
struct, are relevant and necessary for the new functionality and optimizations.
56-58
: Approved: Introduction of new type aliases.The new type aliases
relaxed_data_with_meta_t
andrelaxed_data_no_meta_t
usingcombine_standard_layout_t
are relevant and necessary for supporting different memory layouts based on theembed_relaxed
constant.
71-78
: Approved: Modifications toinner_t
struct anddata_t
union.The changes to the
inner_t
struct, including the addition of a pointer torelaxed_t
, and the modifications to thedata_t
union are relevant and necessary for new functionality and optimizations.
83-89
: Approved: Conditional inclusion ofkind_t
inimpl_data_t
struct.The modification to conditionally include
kind_t
in theimpl_data_t
struct based on theIMMER_TAGGED_NODE
macro is relevant and necessary for supporting conditional compilation for tagged nodes.
Line range hint
100-151
:
Approved: Introduction of newconstexpr
functions and constants.The new
constexpr
functions (sizeof_packed_leaf_n
,sizeof_packed_inner_n
,sizeof_packed_relaxed_n
,sizeof_packed_inner_r_n
) and themax_sizeof_*
constants are relevant and necessary for new functionality and optimizations. The modifications to thesizeof_*_n
functions to usekeep_headroom
are also appropriate.
163-187
: Approved: Introduction of new member functions.The new member functions
relaxed
,inner
, andleaf
are relevant and necessary for new functionality and optimizations. The inclusion of assertions ensures correctness.
202-218
: Approved: Introduction of new static member functions.The new static member functions
make_inner_n_into
,make_inner_n
, andmake_inner_e
are relevant and necessary for creating and initializing inner nodes.
Line range hint
222-252
:
Approved: Introduction of new static member functions.The new static member functions
make_inner_r_n
,make_inner_sr_n
, andmake_inner_r_e
are relevant and necessary for creating and initializing relaxed inner nodes.src/immer/detail/hamts/node.hpp (16)
11-17
: Include necessary headers for C++ standard library.The inclusion of
<immer/config.hpp>
,<immer/detail/combine_standard_layout.hpp>
,<immer/detail/hamts/bits.hpp>
,<immer/detail/util.hpp>
,<cassert>
, and<cstddef>
is appropriate and necessary for the functionality provided in this file.
23-26
: Ensure compatibility with C++14 and MSVC.The
destroy_at
function template is correctly defined to support C++14 and handle MSVC corner cases.
Line range hint
35-64
:
Correct use of type aliases and nested structs.The
node
struct definition and associated type aliases, such asnode_t
,memory
,heap_policy
,heap
,transience
,refs_t
,ownee_t
,edit_t
,value_t
,bitmap_t
, and nested structscollision_t
andvalues_data_t
are correctly defined and necessary for the functionality provided in this file.
64-69
: Correct use ofvalues_t
type alias andinner_t
struct.The
values_t
type alias andinner_t
struct are correctly defined and necessary for handling node values and inner node data.
Line range hint
74-88
:
Correct use ofdata_t
union andimpl_data_t
struct.The
data_t
union andimpl_data_t
struct are correctly defined and necessary for handling node data and implementation details.
94-108
: Correct implementation of size calculation methods.The
sizeof_values_n
,sizeof_collision_n
, andsizeof_inner_n
methods are correctly implemented to calculate the sizes of values, collision, and inner nodes.
111-149
: Correct implementation of node access methods.The
kind
,values
,children
,datamap
, andnodemap
methods are correctly implemented to access node kind, values, children, datamap, and nodemap.
153-192
: Correct implementation of count and collision access methods.The
data_count
,children_count
,collision_count
, andcollisions
methods are correctly implemented to count data, children, collisions, and access collision data.
195-219
: Correct implementation of reference counting, ownership, and mutation checks.The
refs
,ownee
, andcan_mutate
methods are correctly implemented to handle reference counting, ownership, and mutation checks.
Line range hint
224-382
:
Correct implementation of node creation and mutable values methods.The
make_inner_n
,make_collision_n
, andensure_mutable_values
methods are correctly implemented to create inner and collision nodes, and ensure mutable values.
383-481
: Correct implementation of collision insertion and removal methods.The
copy_collision_insert
,move_collision_insert
,copy_collision_remove
, andmove_collision_remove
methods are correctly implemented to handle collision insertion and removal.
483-552
: Correct implementation of collision replacement, inner replacement, and ownership methods.The
copy_collision_replace
,copy_inner_replace
,owned
,owned_values
, andowned_values_safe
methods are correctly implemented to handle collision replacement, inner replacement, and ownership.
554-788
: Correct implementation of inner replacement and value replacement methods.The
copy_inner_replace_value
,copy_inner_replace_merged
,move_inner_replace_merged
,copy_inner_replace_inline
, andmove_inner_replace_inline
methods are correctly implemented to handle inner replacement and value replacement.
790-977
: Correct implementation of inner value removal and insertion methods.The
copy_inner_remove_value
,move_inner_remove_value
,copy_inner_insert_value
, andmove_inner_insert_value
methods are correctly implemented to handle inner value removal and insertion.
981-1040
: Correct implementation of merged node creation methods.The
make_merged
andmake_merged_e
methods are correctly implemented to handle merged node creation.
Line range hint
1041-1135
:
Correct implementation of reference counting, node deletion, and deallocation methods.The
inc
,dec
,inc_nodes
,delete_values
,delete_inner
,delete_collision
,delete_deep
,delete_deep_shift
,deallocate_values
,deallocate_collision
, anddeallocate_inner
methods are correctly implemented to handle reference counting, node deletion, and deallocation.src/immer/detail/rbts/rrbtree.hpp (20)
50-58
: LGTM!The
empty_root
method correctly creates an empty root node usingstd::aligned_storage_t
for proper alignment.
60-67
: LGTM!The
empty_tail
method correctly creates an empty tail node usingstd::aligned_storage_t
for proper alignment.
72-79
: LGTM!The
from_initializer_list
method correctly creates anrrbtree
from an initializer list using anowner_t
object.
80-88
: LGTM!The
from_range
method correctly creates anrrbtree
from a range of iterators using anowner_t
object and ensures compatibility with different iterator types.
93-100
: LGTM!The
from_fill
method correctly creates anrrbtree
by filling it with a specified value using anowner_t
object.
101-109
: LGTM!The default constructor correctly initializes the
rrbtree
with default values and asserts the tree's integrity.
110-117
: LGTM!The parameterized constructor correctly initializes the
rrbtree
with specified values and asserts the tree's integrity.
119-124
: LGTM!The copy constructor correctly initializes the
rrbtree
by copying anotherrrbtree
and increments the reference count.
125-129
: LGTM!The move constructor correctly initializes the
rrbtree
by moving anotherrrbtree
and swaps the contents with the otherrrbtree
.
Line range hint
131-137
:
LGTM!The copy assignment operator correctly uses the copy-and-swap idiom to assign the contents of another
rrbtree
.
138-143
: LGTM!The move assignment operator correctly uses the move-and-swap idiom to assign the contents of another
rrbtree
.
144-150
: LGTM!The
swap
method correctly usesstd::swap
to swap the contents of tworrbtree
objects.
153-153
: LGTM!The destructor correctly uses the
dec
method to decrement the reference count of the root and tail nodes.
155-159
: LGTM!The
inc
method correctly increments the reference count of the root and tail nodes.
161-161
: LGTM!The
dec
method correctly uses thetraverse
method with adec_visitor
to decrement the reference count.
163-163
: LGTM!The
tail_size
method correctly calculates the size of the tail by subtracting the tail offset from the total size.
165-172
: LGTM!The
tail_offset
method correctly calculates the offset of the tail based on the root node's relaxed state and the total size.
Line range hint
174-189
:
LGTM!The
traverse
method correctly traverses the tree based on the tail offset and size, and applies the visitor to the nodes.
Line range hint
191-211
:
LGTM!The range-based
traverse
method correctly traverses the tree based on the tail offset and size, and applies the visitor to the nodes within the specified range.
Line range hint
213-223
:
LGTM!The
traverse_p
method correctly traverses the tree based on the tail offset and size, and applies the visitor to the nodes, returning a boolean value indicating success.src/immer/detail/hamts/champ.hpp (25)
20-118
: LGTM! Thechamp_debug_stats
struct is well-structured.The addition of
champ_debug_stats
is a useful enhancement for debugging purposes. The methods and friend operators are well-implemented.
Line range hint
130-184
:
LGTM! Thechamp
struct is well-defined.The
champ
struct includes essential methods and member variables. The constructors, destructors, and operations are implemented correctly.
185-190
: LGTM! Theinc
anddec
methods handle reference counting correctly.The methods ensure proper reference counting and handle node deletion appropriately.
193-248
: LGTM! Thedo_check_champ
andcheck_champ
methods ensure data structure integrity.The methods are well-implemented with detailed checks and appropriate use of recursive calls and bitwise operations.
250-280
: LGTM! Thedo_get_debug_stats
andget_debug_stats
methods collect detailed debug statistics.The methods are well-implemented with appropriate use of recursive calls and accumulation of statistics.
282-301
: LGTM! Thefrom_initializer_list
andfrom_range
methods provide convenient ways to create achamp
.The methods are well-implemented with appropriate use of initializer lists and iterators.
311-329
: LGTM! Thefor_each_chunk
andfor_each_chunk_traversal
methods provide a way to iterate over chunks.The methods are well-implemented with appropriate use of recursive calls and function objects.
331-413
: LGTM! Thediff
methods provide a way to calculate differences between twochamp
instances.The methods are well-implemented with appropriate use of recursive calls and bitwise operations.
415-490
: LGTM! Thediff_data_node
,diff_node_data
, anddiff_data_data
methods handle specific cases of differences.The methods are well-implemented with appropriate use of recursive calls and function objects.
492-525
: LGTM! Thediff_collisions
method handles differences in collisions.The method is well-implemented with appropriate use of nested loops and function objects.
Line range hint
537-556
:
LGTM! Theget
method retrieves a value from thechamp
.The method is well-implemented with appropriate use of recursive calls and bitwise operations.
559-622
: LGTM! Theadd_result
struct anddo_add
method handle adding a value to thechamp
.The struct and method are well-implemented with appropriate use of recursive calls and bitwise operations.
623-628
: LGTM! Theadd
method handles adding a value to thechamp
.The method is well-implemented with appropriate use of recursive calls and bitwise operations.
630-731
: LGTM! Theadd_mut_result
struct anddo_add_mut
method handle adding a value to thechamp
with mutation.The struct and method are well-implemented with appropriate use of recursive calls and bitwise operations.
733-740
: LGTM! Theadd_mut
method handles adding a value to thechamp
with mutation.The method is well-implemented with appropriate use of recursive calls and bitwise operations.
743-825
: LGTM! Theupdate_result
struct anddo_update
method handle updating a value in thechamp
.The struct and method are well-implemented with appropriate use of recursive calls and bitwise operations.
830-842
: LGTM! Theupdate
method handles updating a value in thechamp
.The method is well-implemented with appropriate use of recursive calls and bitwise operations.
844-897
: LGTM! Thedo_update_if_exists
method handles updating a value in thechamp
if it exists.The method is well-implemented with appropriate use of recursive calls and bitwise operations.
899-910
: LGTM! Theupdate_if_exists
method handles updating a value in thechamp
if it exists.The method is well-implemented with appropriate use of recursive calls and bitwise operations.
912-1033
: LGTM! Theupdate_mut_result
struct anddo_update_mut
method handle updating a value in thechamp
with mutation.The struct and method are well-implemented with appropriate use of recursive calls and bitwise operations.
1035-1049
: LGTM! Theupdate_mut
method handles updating a value in thechamp
with mutation.The method is well-implemented with appropriate use of recursive calls and bitwise operations.
1051-1146
: LGTM! Theupdate_if_exists_mut_result
struct anddo_update_if_exists_mut
method handle updating a value in thechamp
with mutation if it exists.The struct and method are well-implemented with appropriate use of recursive calls and bitwise operations.
1149-1159
: LGTM! Theupdate_if_exists_mut
method handles updating a value in thechamp
with mutation if it exists.The method is well-implemented with appropriate use of recursive calls and bitwise operations.
1176-1194
: LGTM! Thesub_result
struct handles the result of a subtraction operation.The struct is well-implemented with appropriate use of union and enum.
Line range hint
1198-1269
:
LGTM! Thedo_sub
method handles performing a subtraction operation on thechamp
.The method is well-implemented with appropriate use of recursive calls and bitwise operations.
src/immer/detail/rbts/position.hpp (26)
16-16
: Include<utility>
forstd::forward
The addition of
<utility>
is appropriate for usingstd::forward
in perfect forwarding.
41-43
: Add methodsnode()
andsize()
toempty_regular_pos
The new methods provide access to the
node_
pointer and size information, consistent with existing methods.
46-52
: Addeach
andeach_pred
methods toempty_regular_pos
The new methods provide iteration capabilities, consistent with the struct's purpose.
55-57
: Addvisit
method toempty_regular_pos
The new method allows a visitor to interact with the struct, using
std::forward
for perfect forwarding.
74-76
: Add methodsnode()
andsize()
toempty_leaf_pos
The new methods provide access to the
node_
pointer and size information, consistent with existing methods.
78-79
: Addvisit
method toempty_leaf_pos
The new method allows a visitor to interact with the struct, using
std::forward
for perfect forwarding.
103-104
: Add methodsnode()
andsize()
toleaf_pos
The new methods provide access to the
node_
pointer and size information, consistent with existing methods.
109-110
: Addvisit
method toleaf_pos
The new method allows a visitor to interact with the struct, using
std::forward
for perfect forwarding.
135-136
: Add methodsnode()
andsize()
toleaf_sub_pos
The new methods provide access to the
node_
pointer and size information, consistent with existing methods.
141-142
: Addvisit
method toleaf_sub_pos
The new method allows a visitor to interact with the struct, using
std::forward
for perfect forwarding.
165-171
: Add methodsnode()
anddescend
toleaf_descent_pos
The new methods provide access to the
node_
pointer and a placeholder for descent operation, consistent with existing methods.
173-174
: Addvisit
method toleaf_descent_pos
The new method allows a visitor to interact with the struct, using
std::forward
for perfect forwarding.
197-198
: Add methodsnode()
andsize()
tofull_leaf_pos
The new methods provide access to the
node_
pointer and size information, consistent with existing methods.
203-204
: Addvisit
method tofull_leaf_pos
The new method allows a visitor to interact with the struct, using
std::forward
for perfect forwarding.
229-237
: Add methodsnode()
,size()
, andthis_size()
toregular_pos
The new methods provide access to the
node_
pointer, size information, and the size of the current node, consistent with existing methods.
241-243
: Addeach
method toregular_pos
The new method provides iteration capabilities, calling
each_regular
for the actual implementation.
247-249
: Addeach_pred
method toregular_pos
The new method provides predicate-based iteration capabilities, calling
each_pred_regular
for the actual implementation.
253-255
: Addeach_pred_zip
method toregular_pos
The new method provides predicate-based iteration capabilities with another node, calling
each_pred_zip_regular
for the actual implementation.
259-261
: Addeach_pred_i
method toregular_pos
The new method provides predicate-based iteration capabilities with index range, calling
each_pred_i_regular
for the actual implementation.
265-267
: Addeach_pred_right
method toregular_pos
The new method provides predicate-based iteration capabilities from a starting index, calling
each_pred_right_regular
for the actual implementation.
271-273
: Addeach_pred_left
method toregular_pos
The new method provides predicate-based iteration capabilities up to a specified count, calling
each_pred_left_regular
for the actual implementation.
277-279
: Addeach_i
method toregular_pos
The new method provides iteration capabilities with index range, calling
each_i_regular
for the actual implementation.
283-285
: Addeach_right
method toregular_pos
The new method provides iteration capabilities from a starting index, calling
each_right_regular
for the actual implementation.
289-291
: Addeach_left
method toregular_pos
The new method provides iteration capabilities up to a specified count, calling
each_left_regular
for the actual implementation.
295-298
: Addtowards
method toregular_pos
The new method provides navigation capabilities towards a specified index, calling
towards_oh_ch_regular
for the actual implementation.
301-306
: Addtowards_oh
method toregular_pos
The new method provides navigation capabilities towards a specified index with an offset hint, calling
towards_oh_ch_regular
for the actual implementation.src/immer/detail/arrays/no_capacity.hpp (6)
12-17
: Include directives added.The new include directives for
<immer/config.hpp>
,<cassert>
,<cstddef>
, and<stdexcept>
are appropriate and necessary for the added functionality and improved exception handling.
35-38
: Improved initialization inempty
method.The
empty
method now usesnode_t::make_n(0)
for initialization, ensuring correct initialization of an empty node.
Line range hint
79-102
:
Destructor anddata_mut
method added.The destructor ensures proper resource management by calling
dec()
. Thedata_mut
method ensures data mutation is handled correctly.
104-123
: Simplifiedfrom_range
andfrom_fill
methods.The changes improve readability and exception handling in the
from_range
andfrom_fill
methods.
150-150
: Standardized exception handling inget_check
method.The
get_check
method now usesIMMER_THROW
for exception handling, standardizing the approach.
164-198
: Improved exception handling inpush_back
,assoc
, andupdate
methods.The
push_back
,assoc
, andupdate
methods now useIMMER_TRY
,IMMER_CATCH
, andIMMER_RETHROW
for improved exception handling.src/immer/detail/iterator_facade.hpp (2)
22-54
: Core iterator methods added initerator_core_access
.The added methods for dereferencing, incrementing, decrementing, equality checking, advancing, and calculating distance provide essential functionality for iterator operations.
Line range hint
99-194
:
Comprehensive iterator operations initerator_facade
.The added methods for dereferencing, incrementing, decrementing, equality checking, and random access operations ensure comprehensive support for various iterator categories.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Outside diff range, codebase verification and nitpick comments (2)
src/qt/lelantusdialog.cpp (2)
151-152
: Signal-slot parameter mismatch inLelantusDialog
The slots
updateGlobalFeeVariables
andcoinControlUpdateLabels
do not accept any parameters, but they are connected to the signalidClicked(int)
which expects anint
parameter. This will cause a runtime error.
updateGlobalFeeVariables
is defined asvoid updateGlobalFeeVariables()
coinControlUpdateLabels
is defined asvoid coinControlUpdateLabels()
Please update the slots to accept an
int
parameter or connect them to a compatible signal.Analysis chain
Verify signal-slot compatibility after connection update for
groupCustomFee
.The connections for
groupCustomFee
have been updated to useidClicked
instead ofbuttonClicked
. Ensure that the connected slots (updateGlobalFeeVariables
,coinControlUpdateLabels
) are compatible with the new signal signature.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the compatibility of the signal `idClicked` with the connected slots in `LelantusDialog`. # Test: Search for the method implementations in the file to ensure they match the expected signature. rg --type cpp -A 5 $'void LelantusDialog::updateGlobalFeeVariables(int)' src/qt/lelantusdialog.cpp rg --type cpp -A 5 $'void LelantusDialog::coinControlUpdateLabels(int)' src/qt/lelantusdialog.cppLength of output: 198
Script:
#!/bin/bash # Description: Search for any definitions of `updateGlobalFeeVariables` and `coinControlUpdateLabels` in the codebase to verify their signatures. # Search for the definition of `updateGlobalFeeVariables` in the codebase rg --type cpp -A 5 'updateGlobalFeeVariables' # Search for the definition of `coinControlUpdateLabels` in the codebase rg --type cpp -A 5 'coinControlUpdateLabels'Length of output: 18423
148-150
: Signal-slot compatibility issue detected.The methods
updateFeeSectionControls
,updateGlobalFeeVariables
, andcoinControlUpdateLabels
inLelantusDialog
do not have theint
parameter required by theidClicked(int)
signal. This will result in a mismatch and the slots will not be called correctly.
void LelantusDialog::updateFeeSectionControls()
void LelantusDialog::updateGlobalFeeVariables()
void LelantusDialog::coinControlUpdateLabels()
Please update the method signatures to include the
int
parameter or adjust the signal connection accordingly.Analysis chain
Verify signal-slot compatibility after connection update.
The connections for
groupFee
have been updated to useidClicked
instead ofbuttonClicked
. Ensure that the connected slots (updateFeeSectionControls
,updateGlobalFeeVariables
,coinControlUpdateLabels
) are compatible with the new signal signature.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the compatibility of the signal `idClicked` with the connected slots in `LelantusDialog`. # Test: Search for the method implementations in the file to ensure they match the expected signature. rg --type cpp -A 5 $'void LelantusDialog::updateFeeSectionControls(int)' src/qt/lelantusdialog.cpp rg --type cpp -A 5 $'void LelantusDialog::updateGlobalFeeVariables(int)' src/qt/lelantusdialog.cpp rg --type cpp -A 5 $'void LelantusDialog::coinControlUpdateLabels(int)' src/qt/lelantusdialog.cppLength of output: 298
Script:
#!/bin/bash # Description: Verify the compatibility of the signal `idClicked` with the connected slots in `LelantusDialog`. # Test: Search for the method implementations in the entire repository to ensure they match the expected signature. rg --type cpp -A 5 $'void LelantusDialog::updateFeeSectionControls(int)' rg --type cpp -A 5 $'void LelantusDialog::updateGlobalFeeVariables(int)' rg --type cpp -A 5 $'void LelantusDialog::coinControlUpdateLabels(int)'Length of output: 220
Script:
#!/bin/bash # Description: Verify the existence and signatures of the methods connected to the signal `idClicked` in `LelantusDialog`. # Test: Search for the method implementations in the entire repository without specifying the parameter types. rg --type cpp -A 5 $'void LelantusDialog::updateFeeSectionControls' rg --type cpp -A 5 $'void LelantusDialog::updateGlobalFeeVariables' rg --type cpp -A 5 $'void LelantusDialog::coinControlUpdateLabels'Length of output: 1470
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (22)
- src/qt/addresstablemodel.cpp (4 hunks)
- src/qt/bantablemodel.cpp (3 hunks)
- src/qt/bitcoin.cpp (1 hunks)
- src/qt/bitcoinamountfield.cpp (3 hunks)
- src/qt/bitcoingui.cpp (1 hunks)
- src/qt/guiutil.cpp (2 hunks)
- src/qt/guiutil.h (1 hunks)
- src/qt/lelantusdialog.cpp (2 hunks)
- src/qt/notifymnemonic.cpp (1 hunks)
- src/qt/optionsmodel.cpp (6 hunks)
- src/qt/overviewpage.cpp (1 hunks)
- src/qt/pcodemodel.cpp (2 hunks)
- src/qt/peertablemodel.cpp (2 hunks)
- src/qt/receivecoinsdialog.cpp (1 hunks)
- src/qt/receiverequestdialog.cpp (3 hunks)
- src/qt/recentrequeststablemodel.cpp (1 hunks)
- src/qt/recentrequeststablemodel.h (1 hunks)
- src/qt/sendcoinsdialog.cpp (2 hunks)
- src/qt/splashscreen.h (1 hunks)
- src/qt/transactiontablemodel.cpp (1 hunks)
- src/qt/transactionview.cpp (4 hunks)
- src/qt/utilitydialog.h (1 hunks)
Files skipped from review due to trivial changes (1)
- src/qt/optionsmodel.cpp
Additional comments not posted (36)
src/qt/utilitydialog.h (1)
45-45
: Approved: Constructor signature change inShutdownWindow
class.The modification from
Qt::WindowFlags f=0
toQt::WindowFlags f=Qt::WindowFlags()
is a best practice in C++, enhancing type safety and clarity.src/qt/splashscreen.h (1)
24-24
: Approved: Constructor signature update inSplashScreen
class.Changing the default value for
Qt::WindowFlags f
from0
toQt::WindowFlags()
enhances type safety and code clarity, aligning with modern C++ best practices.src/qt/notifymnemonic.cpp (1)
33-33
: Approved: Simplification of translation function inNotifyMnemonic
class.Replacing
trUtf8
withtr
simplifies the translation process and aligns with standard practices in Qt, which supports UTF-8 by default intr
.src/qt/recentrequeststablemodel.h (1)
85-85
: Approved: Method signature update inRecentRequestsTableModel
class.Adding a default value of
QModelIndex()
to theparent
parameter in theindex
method enhances usability by allowing simpler calls to this method, aligning with Qt model/view best practices.src/qt/bantablemodel.cpp (3)
68-68
: Approved change fromqStableSort
tostd::stable_sort
.This change aligns with modern C++ standards and should maintain the intended functionality as long as the custom comparator
BannedNodeLessThan
supports it.
130-130
: Approved change in date formatting method.Using
QLocale::system().toString
for date formatting enhances localization support, making the application more adaptable to various regional settings.
152-152
: Approved change in return value for invalid indices inflags
method.Returning
Qt::ItemFlags()
instead of0
improves type safety and code clarity.src/qt/pcodemodel.cpp (2)
132-132
: Explicit return type in flags function.The change from returning
0
toQt::ItemFlags()
is a good practice as it makes the return type explicit, which is safer and more readable.
248-248
: Updated sorting algorithm to std::sort.Switching to
std::sort
fromqSort
is a positive change asstd::sort
is more efficient and is the standard way in C++ to perform sorting. Ensure thatsortPred
is correctly defined and used.src/qt/bitcoinamountfield.cpp (3)
10-10
: Included guiutil.h for additional functionalities.The inclusion of
guiutil.h
is necessary for the new method callGUIUtil::TextWidth
used in theAmountSpinBox
class. This change supports better modularity and code clarity.
106-106
: Replaced BitcoinUnits::format with GUIUtil::TextWidth in minimumSizeHint.This change likely aims to improve the performance or accuracy of width calculations. It's essential to verify that
GUIUtil::TextWidth
provides correct and efficient width calculations for UI elements.
178-178
: Initialization of StepEnabled using default constructor.Using
StepEnabled()
instead of0
for initialization is a good practice as it avoids implicit conversions and makes the code type-safe and clearer.src/qt/overviewpage.cpp (1)
477-477
: Review: Adjustment to Standard Buttons in Dialog ConstructorThe change from
setStandardButtons(0)
tosetStandardButtons(StandardButtons())
alters how buttons are managed in the dialog. This change should ensure that no standard buttons are set unless explicitly specified elsewhere in the code. It's crucial to verify that this behavior is intended and that the dialog's functionality aligns with user expectations and UI consistency.Verification successful
Review: Adjustment to Standard Buttons in Dialog Constructor
The change from
setStandardButtons(0)
tosetStandardButtons(StandardButtons())
does not introduce any side effects. The dialog's functionality remains consistent with user expectations and UI consistency as no standard buttons are explicitly set or relied upon in the observed usage.
src/qt/overviewpage.cpp
src/qt/sendcoinsdialog.cpp
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify other usages of MigrateLelantusToSparkDialog to ensure consistency in button settings. # Test: Search for other instances of MigrateLelantusToSparkDialog usage. rg --type cpp "MigrateLelantusToSparkDialog" src/Length of output: 1077
Script:
#!/bin/bash # Description: Check the usage of MigrateLelantusToSparkDialog in src/qt/overviewpage.cpp and src/qt/sendcoinsdialog.cpp to verify standard button settings. # Search for MigrateLelantusToSparkDialog instantiation and subsequent method calls in src/qt/overviewpage.cpp rg -A 10 "MigrateLelantusToSparkDialog" src/qt/overviewpage.cpp # Search for MigrateLelantusToSparkDialog instantiation and subsequent method calls in src/qt/sendcoinsdialog.cpp rg -A 10 "MigrateLelantusToSparkDialog" src/qt/sendcoinsdialog.cppLength of output: 2582
src/qt/guiutil.cpp (5)
897-900
: Review:TextWidth
Calculation UpdateThe
TextWidth
function now useshorizontalAdvance
instead of the deprecatedwidth
method from previous Qt versions. This update is crucial for correct text measurement in UI components, especially when dealing with variable-width fonts. Ensure this change is reflected everywhereTextWidth
is used to avoid UI layout issues.Verification successful
Review:
TextWidth
Calculation UpdateThe
TextWidth
function has been updated to usehorizontalAdvance
instead of the deprecatedwidth
method. This update is crucial for correct text measurement in UI components, especially when dealing with variable-width fonts. The search results confirm that the newTextWidth
function is used correctly in the following files:
src/qt/sendcoinsdialog.cpp
src/qt/bitcoingui.cpp
src/qt/bitcoinamountfield.cpp
src/qt/lelantusdialog.cpp
No instances of the deprecated
width
method were found in these usages.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Ensure that TextWidth is used correctly with the new method. # Test: Search for TextWidth usage in the project. rg --type cpp "TextWidth" src/Length of output: 1822
911-918
: Review:HasPixmap
Function UpdateThe
HasPixmap
function now supports different Qt versions for checking if aQLabel
has a pixmap. This update is essential for ensuring that UI components are displayed correctly across various Qt versions. Testing across different environments is recommended to confirm that icons and images are handled correctly.Verification successful
The
HasPixmap
function is used multiple times insrc/qt/receiverequestdialog.cpp
. To ensure that it is used consistently and correctly, I will check the context around its usage in this file.
Verification Successful:
HasPixmap
Function UsageThe
HasPixmap
function is used consistently and correctly within thesrc/qt/receiverequestdialog.cpp
file. The function checks if aQLabel
has a pixmap before performing actions, ensuring compatibility across different Qt versions.
mousePressEvent
saveImage
copyImage
contextMenuEvent
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that HasPixmap is used consistently and correctly across the project. # Test: Search for HasPixmap usage in the project. rg --type cpp "HasPixmap" src/Length of output: 491
Script:
#!/bin/bash # Description: Check the context around the usage of HasPixmap in src/qt/receiverequestdialog.cpp # Display lines around each usage of HasPixmap rg --type cpp --context 5 "HasPixmap" src/qt/receiverequestdialog.cppLength of output: 1003
920-931
: Review:GetImage
Function ImplementationThe
GetImage
function retrieves an image from aQLabel
, considering different Qt versions. This function is crucial for image manipulation tasks within the UI. Ensure that this function is used properly where image data is required from labels, and test across different Qt versions for consistency.Verification successful
Verification Successful: Proper usage of
GetImage
functionThe
GetImage
function is used appropriately within theQRImageWidget::exportImage
method insrc/qt/receiverequestdialog.cpp
. The function is correctly utilized to retrieve image data from the widget, which is then used in themousePressEvent
method to set image data in aQMimeData
object.
src/qt/receiverequestdialog.cpp
: Verified usage inQRImageWidget::exportImage
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for proper usage of GetImage in the project. # Test: Search for GetImage usage in the project. rg --type cpp "GetImage" src/Length of output: 212
Script:
#!/bin/bash # Extract lines around the usage of GetImage in src/qt/receiverequestdialog.cpp to verify proper usage. rg --type cpp -A 10 -B 10 "GetImage" src/qt/receiverequestdialog.cppLength of output: 799
902-909
: Review:StartOfDay
Function EnhancementThe
StartOfDay
function now handles different Qt versions to ensure compatibility. For Qt versions 5.14 and above, it usesstartOfDay()
, which is more precise and straightforward. This change improves the function's reliability across different Qt versions. Verify that this function's behavior remains consistent across different system settings and Qt versions.
93-93
: Review: UpdateddateTimeStr
FunctionThe
dateTimeStr
function now usesQLocale::system()
for formatting the date, which should adapt the date display to the user's system locale settings. This change enhances user experience by displaying dates in a familiar format. Ensure that all date usages throughout the application are tested to confirm they handle locale formats correctly.Verification successful
Review: Updated
dateTimeStr
FunctionThe
dateTimeStr
function now usesQLocale::system()
for formatting the date, which should adapt the date display to the user's system locale settings. This change enhances user experience by displaying dates in a familiar format. The usages ofdateTimeStr
across the codebase, such as inwalletdb.cpp
,recentrequeststablemodel.cpp
,overviewpage.cpp
,transactiontablemodel.cpp
,transactiondesc.cpp
,lelantuscoincontroldialog.cpp
, andcoincontroldialog.cpp
, appear to be compatible with the new format. Ensure that all date usages throughout the application are tested to confirm they handle locale formats correctly.
src/qt/guiutil.cpp
src/wallet/walletdb.cpp
src/qt/recentrequeststablemodel.cpp
src/qt/overviewpage.cpp
src/qt/transactiontablemodel.cpp
src/qt/transactiondesc.cpp
src/qt/lelantuscoincontroldialog.cpp
src/qt/coincontroldialog.cpp
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for other usages of dateTimeStr to ensure they handle the new format correctly. # Test: Search for dateTimeStr usage in the project. rg --type cpp "dateTimeStr" src/Length of output: 1558
Script:
#!/bin/bash # Description: Inspect the context around each usage of dateTimeStr to verify if they handle the new locale-aware format correctly. # Extract lines around each usage of dateTimeStr to understand the context. rg --type cpp "dateTimeStr" -A 5 -B 5 src/Length of output: 9593
src/qt/bitcoin.cpp (1)
432-432
: Review: Updated SplashScreen InitializationThe
createSplashScreen
method now explicitly usesQt::WindowFlags()
for initializing theSplashScreen
object, which should ensure that no unintended window flags are set. This change is a good practice for clarity and avoiding potential issues with default parameters. Testing on different platforms is recommended to ensure that the splash screen behaves as expected.Verification successful
Review: Updated SplashScreen Initialization
The
createSplashScreen
method now explicitly usesQt::WindowFlags()
for initializing theSplashScreen
object, which should ensure that no unintended window flags are set. This change is a good practice for clarity and avoiding potential issues with default parameters. Testing on different platforms is recommended to ensure that the splash screen behaves as expected.To verify the consistent behavior, we need to check the
SplashScreen
constructor implementation insrc/qt/splashscreen.cpp
.
Review: Updated SplashScreen Initialization
The
createSplashScreen
method now explicitly usesQt::WindowFlags()
for initializing theSplashScreen
object, which should ensure that no unintended window flags are set. This change is a good practice for clarity and avoiding potential issues with default parameters. TheSplashScreen
constructor correctly handles theQt::WindowFlags
parameter, confirming that the change is appropriate.
- File:
src/qt/bitcoin.cpp
- Lines: 432
Testing on different platforms is recommended to ensure that the splash screen behaves as expected.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the consistent behavior of the splash screen across different platforms. # Test: Search for other instances where SplashScreen is used or tested. rg --type cpp "SplashScreen" src/Length of output: 2481
Script:
#!/bin/bash # Description: Verify the SplashScreen constructor implementation to ensure it handles Qt::WindowFlags() properly. # Extract the SplashScreen constructor implementation from src/qt/splashscreen.cpp ast-grep --lang cpp --pattern $'class SplashScreen { $$$ SplashScreen(const QPixmap &pixmap, Qt::WindowFlags f) : QSplashScreen(pixmap, f) { $$$ } $$$ }' src/qt/splashscreen.cppLength of output: 535
Script:
#!/bin/bash # Description: Verify the SplashScreen constructor implementation to ensure it handles Qt::WindowFlags() properly. # Search for the SplashScreen constructor in src/qt/splashscreen.cpp rg "SplashScreen::SplashScreen" src/qt/splashscreen.cpp -A 10Length of output: 827
src/qt/lelantusdialog.cpp (1)
566-566
: Review the updated indent setting method forfallbackFeeWarningLabel
.The method for setting the indent of
fallbackFeeWarningLabel
has been updated to useGUIUtil::TextWidth
. Ensure that this utility method correctly calculates the width based on the font metrics and the specified text, and that it integrates well with the rest of the UI updates.Verification successful
The updated method for setting the indent of
fallbackFeeWarningLabel
is correctly implemented.The
GUIUtil::TextWidth
method usesQFontMetrics::horizontalAdvance
to accurately calculate the width of the text, ensuring the indent is set appropriately. This change is valid and improves the consistency of the UI.
- Implementation found in
src/qt/guiutil.cpp
:int TextWidth(const QFontMetrics& fm, const QString& text) { return fm.horizontalAdvance(text); }Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the implementation and behavior of `GUIUtil::TextWidth`. # Test: Search for the implementation of `GUIUtil::TextWidth` to ensure it behaves as expected. rg --type cpp -A 10 $'int GUIUtil::TextWidth' src/qt/guiutil.cppLength of output: 65
Script:
#!/bin/bash # Description: Locate the implementation of `GUIUtil::TextWidth` in the entire codebase. # Step 1: Search for the declaration of `TextWidth` in header files. rg --type cpp --type hpp -A 5 'TextWidth' # Step 2: Search for the implementation of `TextWidth` in source files. rg --type cpp -A 10 'TextWidth'Length of output: 7587
src/qt/transactionview.cpp (2)
293-316
: Refactor date handling inchooseDate
method.The changes correctly utilize
GUIUtil::StartOfDay
to ensure that the date handling starts from the start of the day, which is a more precise way to handle date ranges in the UI. This should prevent any off-by-one errors or similar issues related to date boundaries.
665-666
: Ensure consistent date range handling indateRangeChanged
.The modifications to use
GUIUtil::StartOfDay
for bothdateFrom
anddateTo
ensure that the date ranges are handled consistently and accurately, starting from the beginning of the day.src/qt/addresstablemodel.cpp (3)
148-148
: Approved change: ReplacedqSort
withstd::sort
.The replacement of
qSort
withstd::sort
is a good move towards using standard C++ libraries, which are often more efficient and well-maintained.
154-156
: Approved change: ReplacedqLowerBound
andqUpperBound
withstd::lower_bound
andstd::upper_bound
.Switching to standard C++ functions for bounds finding is a positive change, enhancing portability and potentially improving performance.
Also applies to: 208-210
466-466
: Approved change: Updated return type forflags
method.Changing the return type from
0
toQt::ItemFlags()
in theflags
method improves type safety and clarity, aligning with modern C++ practices.Also applies to: 825-825
src/qt/bitcoingui.cpp (1)
1416-1416
: Approved change: UseGUIUtil::TextWidth
for calculating maximum width.Using
GUIUtil::TextWidth
instead offm.width
is a more robust and potentially more accurate method for calculating text width, especially when dealing with different fonts and DPI settings.src/qt/sendcoinsdialog.cpp (4)
1096-1096
: Approve the change tosetIndent
usingGUIUtil::TextWidth
.The update to use
GUIUtil::TextWidth
for setting indentation is a good practice as it encapsulates the width calculation, potentially improving maintainability and accuracy.However, ensure that
GUIUtil::TextWidth
is implemented efficiently and correctly handles different scenarios.Verification successful
Approve the change to
setIndent
usingGUIUtil::TextWidth
.The update to use
GUIUtil::TextWidth
for setting indentation is a good practice as it encapsulates the width calculation, potentially improving maintainability and accuracy. The implementation ofGUIUtil::TextWidth
is efficient and correctly handles the calculation usingQFontMetrics::horizontalAdvance
.
src/qt/guiutil.cpp
:int TextWidth(const QFontMetrics& fm, const QString& text) { return fm.horizontalAdvance(text); }
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check the implementation of `GUIUtil::TextWidth`. # Test: Search for the implementation of `GUIUtil::TextWidth` to ensure it's efficient and robust. rg --type cpp 'TextWidth' -A 10Length of output: 7517
195-195
: Verify the new signal-slot connection forcoinControlUpdateLabels
.The connection for
coinControlUpdateLabels
has been updated to useidClicked
for bothgroupFee
andgroupCustomFee
. Confirm that the behavior ofidClicked
matches the expected functionality of the previousbuttonClicked
signal.Also applies to: 197-197
194-196
: Verify the new signal-slot connection forupdateGlobalFeeVariables
.The connection for
updateGlobalFeeVariables
has been updated to useidClicked
for bothgroupFee
andgroupCustomFee
. Confirm that the behavior ofidClicked
matches the expected functionality of the previousbuttonClicked
signal.Also applies to: 197-197
193-193
: Verify the new signal-slot connection forupdateFeeSectionControls
.The connection has been changed to use
idClicked
instead ofbuttonClicked
. Ensure thatidClicked
is triggered in the same scenarios and carries the same data type as the previous signal to maintain functionality.src/qt/peertablemodel.cpp (2)
89-89
: Approved change fromqStableSort
tostd::stable_sort
.Switching to
std::stable_sort
aligns with modern C++ standards and ensures better compatibility and performance across different compilers and platforms.
200-200
: Improvement in returningQt::ItemFlags()
instead of0
.Returning
Qt::ItemFlags()
instead of a plain0
enhances type safety and readability, making the code more idiomatic and less prone to errors related to type mismatches.src/qt/receiverequestdialog.cpp (3)
46-46
: Approved use ofGUIUtil::GetImage
for image export.Using a centralized utility function for image handling simplifies the code and promotes reuse, which is beneficial for maintainability and potential future updates.
51-51
: Approved use ofGUIUtil::HasPixmap
in mouse event handling.Centralizing the check for pixmap existence through
GUIUtil::HasPixmap
helps in maintaining consistency and potentially reduces errors by abstracting the pixmap-related logic.
67-67
: Approved use ofGUIUtil::HasPixmap
for image operations.Replacing direct pixmap checks with
GUIUtil::HasPixmap
in methods likesaveImage
,copyImage
, and during context menu events ensures a consistent approach to handling image availability checks.Also applies to: 78-78, 85-85
src/qt/recentrequeststablemodel.cpp (1)
223-223
: Approved change fromqSort
tostd::sort
.This change is consistent with modern C++ practices and ensures better performance and compatibility across different platforms and compilers.
src/qt/transactionview.cpp
Outdated
@@ -17,6 +17,7 @@ | |||
#include "transactiontablemodel.h" | |||
#include "walletmodel.h" | |||
#include "pcodemodel.h" | |||
#include "guiutil.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Header inclusion of guiutil.h
is redundant.
The header guiutil.h
is included twice in this file. Redundant includes can lead to confusion and clutter in the codebase.
-#include "guiutil.h"
Committable suggestion was skipped due to low confidence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (22)
- src/qt/addresstablemodel.cpp (4 hunks)
- src/qt/bantablemodel.cpp (3 hunks)
- src/qt/bitcoin.cpp (1 hunks)
- src/qt/bitcoinamountfield.cpp (3 hunks)
- src/qt/bitcoingui.cpp (1 hunks)
- src/qt/guiutil.cpp (2 hunks)
- src/qt/guiutil.h (1 hunks)
- src/qt/lelantusdialog.cpp (2 hunks)
- src/qt/notifymnemonic.cpp (1 hunks)
- src/qt/optionsmodel.cpp (6 hunks)
- src/qt/overviewpage.cpp (1 hunks)
- src/qt/pcodemodel.cpp (2 hunks)
- src/qt/peertablemodel.cpp (2 hunks)
- src/qt/receivecoinsdialog.cpp (1 hunks)
- src/qt/receiverequestdialog.cpp (3 hunks)
- src/qt/recentrequeststablemodel.cpp (1 hunks)
- src/qt/recentrequeststablemodel.h (1 hunks)
- src/qt/sendcoinsdialog.cpp (2 hunks)
- src/qt/splashscreen.h (1 hunks)
- src/qt/transactiontablemodel.cpp (1 hunks)
- src/qt/transactionview.cpp (3 hunks)
- src/qt/utilitydialog.h (1 hunks)
Files skipped from review as they are similar to previous changes (22)
- src/qt/addresstablemodel.cpp
- src/qt/bantablemodel.cpp
- src/qt/bitcoin.cpp
- src/qt/bitcoinamountfield.cpp
- src/qt/bitcoingui.cpp
- src/qt/guiutil.cpp
- src/qt/guiutil.h
- src/qt/lelantusdialog.cpp
- src/qt/notifymnemonic.cpp
- src/qt/optionsmodel.cpp
- src/qt/overviewpage.cpp
- src/qt/pcodemodel.cpp
- src/qt/peertablemodel.cpp
- src/qt/receivecoinsdialog.cpp
- src/qt/receiverequestdialog.cpp
- src/qt/recentrequeststablemodel.cpp
- src/qt/recentrequeststablemodel.h
- src/qt/sendcoinsdialog.cpp
- src/qt/splashscreen.h
- src/qt/transactiontablemodel.cpp
- src/qt/transactionview.cpp
- src/qt/utilitydialog.h
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
Except for |
Supersedes #1423
Update lib immer to a more recent version (v0.8.1 5875f7739a6c642ad58cbedadb509c86d4212). This fixes a lot of random warnings we have in lib immer.
Fixed warnings in Linux / Clang.
Fixed warnings in Win cross-compile.