[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).diff --git a/llvm/include/llvm/ADT/DenseMap.h b/llvm/include/llvm/ADT/DenseMap.h
index b478ce2..e13a2cb 100644
--- a/llvm/include/llvm/ADT/DenseMap.h
+++ b/llvm/include/llvm/ADT/DenseMap.h
@@ -710,9 +710,11 @@
unsigned NumBuckets;
public:
- /// Create a DenseMap with an optional \p InitialReserve that guarantee that
- /// this number of elements can be inserted in the map without grow()
- explicit DenseMap(unsigned InitialReserve = 0) { init(InitialReserve); }
+ /// Create a DenseMap with an optional \p NumElementsToReserve to guarantee
+ /// that this number of elements can be inserted in the map without grow().
+ explicit DenseMap(unsigned NumElementsToReserve = 0) {
+ init(NumElementsToReserve);
+ }
DenseMap(const DenseMap &other) : BaseT() {
init(0);
@@ -887,8 +889,8 @@
AlignedCharArrayUnion<BucketT[InlineBuckets], LargeRep> storage;
public:
- explicit SmallDenseMap(unsigned NumElementsToReservre = 0) {
- init(NumElementsToReservre);
+ explicit SmallDenseMap(unsigned NumElementsToReserve = 0) {
+ init(NumElementsToReserve);
}
SmallDenseMap(const SmallDenseMap &other) : BaseT() {