Skip to content

Commit 885546c

Browse files
[ADT] Adjust parameter names for DenseMap constructors (NFC) (#158501)
This patch ensures that both DenseMap and SmallDenseMap have: explicit DenseMap(unsigned NumElementsToReserve = 0) { init(NumElementsToReserve); } for consistency and clarity (modulo the class name, of course).
1 parent 7dd2f1c commit 885546c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

llvm/include/llvm/ADT/DenseMap.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -710,9 +710,11 @@ class DenseMap : public DenseMapBase<DenseMap<KeyT, ValueT, KeyInfoT, BucketT>,
710710
unsigned NumBuckets;
711711

712712
public:
713-
/// Create a DenseMap with an optional \p InitialReserve that guarantee that
714-
/// this number of elements can be inserted in the map without grow()
715-
explicit DenseMap(unsigned InitialReserve = 0) { init(InitialReserve); }
713+
/// Create a DenseMap with an optional \p NumElementsToReserve to guarantee
714+
/// that this number of elements can be inserted in the map without grow().
715+
explicit DenseMap(unsigned NumElementsToReserve = 0) {
716+
init(NumElementsToReserve);
717+
}
716718

717719
DenseMap(const DenseMap &other) : BaseT() {
718720
init(0);
@@ -887,8 +889,8 @@ class SmallDenseMap
887889
AlignedCharArrayUnion<BucketT[InlineBuckets], LargeRep> storage;
888890

889891
public:
890-
explicit SmallDenseMap(unsigned NumElementsToReservre = 0) {
891-
init(NumElementsToReservre);
892+
explicit SmallDenseMap(unsigned NumElementsToReserve = 0) {
893+
init(NumElementsToReserve);
892894
}
893895

894896
SmallDenseMap(const SmallDenseMap &other) : BaseT() {

0 commit comments

Comments
 (0)