Skip to content

Commit 876e2f7

Browse files
DKLoehrroubert
authored andcommitted
ICU-23107 remove unnecessary virtual specifiers
1 parent 42be787 commit 876e2f7

File tree

4 files changed

+104
-105
lines changed

4 files changed

+104
-105
lines changed

icu4c/source/common/unicode/uniset.h

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ class U_COMMON_API UnicodeSet final : public UnicodeFilter {
495495
* @return <tt>true</tt> if the specified set is equal to this set.
496496
* @stable ICU 2.0
497497
*/
498-
virtual bool operator==(const UnicodeSet& o) const;
498+
bool operator==(const UnicodeSet& o) const;
499499

500500
/**
501501
* Compares the specified object with this set for equality. Returns
@@ -522,7 +522,7 @@ class U_COMMON_API UnicodeSet final : public UnicodeFilter {
522522
* @see Object#hashCode()
523523
* @stable ICU 2.0
524524
*/
525-
virtual int32_t hashCode() const;
525+
int32_t hashCode() const;
526526

527527
/**
528528
* Get a UnicodeSet pointer from a USet
@@ -792,15 +792,15 @@ class U_COMMON_API UnicodeSet final : public UnicodeFilter {
792792
* @stable ICU 2.0
793793
* @see getRangeCount
794794
*/
795-
virtual int32_t size() const;
795+
int32_t size() const;
796796

797797
/**
798798
* Returns <tt>true</tt> if this set contains no elements.
799799
*
800800
* @return <tt>true</tt> if this set contains no elements.
801801
* @stable ICU 2.0
802802
*/
803-
virtual UBool isEmpty() const;
803+
UBool isEmpty() const;
804804

805805
/**
806806
* @return true if this set contains multi-character strings or the empty string.
@@ -825,7 +825,7 @@ class U_COMMON_API UnicodeSet final : public UnicodeFilter {
825825
* @return true if the test condition is met
826826
* @stable ICU 2.0
827827
*/
828-
virtual UBool contains(UChar32 start, UChar32 end) const;
828+
UBool contains(UChar32 start, UChar32 end) const;
829829

830830
/**
831831
* Returns <tt>true</tt> if this set contains the given
@@ -843,7 +843,7 @@ class U_COMMON_API UnicodeSet final : public UnicodeFilter {
843843
* @return true if the test condition is met
844844
* @stable ICU 2.4
845845
*/
846-
virtual UBool containsAll(const UnicodeSet& c) const;
846+
UBool containsAll(const UnicodeSet& c) const;
847847

848848
/**
849849
* Returns true if this set contains all the characters
@@ -1021,7 +1021,7 @@ class U_COMMON_API UnicodeSet final : public UnicodeFilter {
10211021
* Implement UnicodeMatcher::matches()
10221022
* @stable ICU 2.4
10231023
*/
1024-
virtual UMatchDegree matches(const Replaceable& text,
1024+
UMatchDegree matches(const Replaceable& text,
10251025
int32_t& offset,
10261026
int32_t limit,
10271027
UBool incremental) override;
@@ -1231,7 +1231,7 @@ class U_COMMON_API UnicodeSet final : public UnicodeFilter {
12311231
* to this set.
12321232
* @stable ICU 2.0
12331233
*/
1234-
virtual UnicodeSet& add(UChar32 start, UChar32 end);
1234+
UnicodeSet& add(UChar32 start, UChar32 end);
12351235

12361236
/**
12371237
* Adds the specified character to this set if it is not already
@@ -1337,7 +1337,7 @@ class U_COMMON_API UnicodeSet final : public UnicodeFilter {
13371337
* @param end last character, inclusive, of range
13381338
* @stable ICU 2.0
13391339
*/
1340-
virtual UnicodeSet& retain(UChar32 start, UChar32 end);
1340+
UnicodeSet& retain(UChar32 start, UChar32 end);
13411341

13421342

13431343
/**
@@ -1375,7 +1375,7 @@ class U_COMMON_API UnicodeSet final : public UnicodeFilter {
13751375
* from this set.
13761376
* @stable ICU 2.0
13771377
*/
1378-
virtual UnicodeSet& remove(UChar32 start, UChar32 end);
1378+
UnicodeSet& remove(UChar32 start, UChar32 end);
13791379

13801380
/**
13811381
* Removes the specified character from this set if it is present.
@@ -1412,7 +1412,7 @@ class U_COMMON_API UnicodeSet final : public UnicodeFilter {
14121412
* A frozen set will not be modified.
14131413
* @stable ICU 2.0
14141414
*/
1415-
virtual UnicodeSet& complement();
1415+
UnicodeSet& complement();
14161416

14171417
/**
14181418
* Complements the specified range in this set. Any character in
@@ -1426,7 +1426,7 @@ class U_COMMON_API UnicodeSet final : public UnicodeFilter {
14261426
* @param end last character, inclusive, of range
14271427
* @stable ICU 2.0
14281428
*/
1429-
virtual UnicodeSet& complement(UChar32 start, UChar32 end);
1429+
UnicodeSet& complement(UChar32 start, UChar32 end);
14301430

14311431
/**
14321432
* Complements the specified character in this set. The character
@@ -1463,7 +1463,7 @@ class U_COMMON_API UnicodeSet final : public UnicodeFilter {
14631463
* @see #add(UChar32, UChar32)
14641464
* @stable ICU 2.0
14651465
*/
1466-
virtual UnicodeSet& addAll(const UnicodeSet& c);
1466+
UnicodeSet& addAll(const UnicodeSet& c);
14671467

14681468
/**
14691469
* Retains only the elements in this set that are contained in the
@@ -1476,7 +1476,7 @@ class U_COMMON_API UnicodeSet final : public UnicodeFilter {
14761476
* @param c set that defines which elements this set will retain.
14771477
* @stable ICU 2.0
14781478
*/
1479-
virtual UnicodeSet& retainAll(const UnicodeSet& c);
1479+
UnicodeSet& retainAll(const UnicodeSet& c);
14801480

14811481
/**
14821482
* Removes from this set all of its elements that are contained in the
@@ -1489,7 +1489,7 @@ class U_COMMON_API UnicodeSet final : public UnicodeFilter {
14891489
* this set.
14901490
* @stable ICU 2.0
14911491
*/
1492-
virtual UnicodeSet& removeAll(const UnicodeSet& c);
1492+
UnicodeSet& removeAll(const UnicodeSet& c);
14931493

14941494
/**
14951495
* Complements in this set all elements contained in the specified
@@ -1501,15 +1501,15 @@ class U_COMMON_API UnicodeSet final : public UnicodeFilter {
15011501
* this set.
15021502
* @stable ICU 2.4
15031503
*/
1504-
virtual UnicodeSet& complementAll(const UnicodeSet& c);
1504+
UnicodeSet& complementAll(const UnicodeSet& c);
15051505

15061506
/**
15071507
* Removes all of the elements from this set. This set will be
15081508
* empty after this call returns.
15091509
* A frozen set will not be modified.
15101510
* @stable ICU 2.0
15111511
*/
1512-
virtual UnicodeSet& clear();
1512+
UnicodeSet& clear();
15131513

15141514
/**
15151515
* Close this set over the given attribute. For the attribute
@@ -1546,7 +1546,7 @@ class U_COMMON_API UnicodeSet final : public UnicodeFilter {
15461546
* @return a reference to this set.
15471547
* @stable ICU 4.2
15481548
*/
1549-
virtual UnicodeSet &removeAllStrings();
1549+
UnicodeSet &removeAllStrings();
15501550

15511551
/**
15521552
* Iteration method that returns the number of ranges contained in
@@ -1555,7 +1555,7 @@ class U_COMMON_API UnicodeSet final : public UnicodeFilter {
15551555
* @see #getRangeEnd
15561556
* @stable ICU 2.4
15571557
*/
1558-
virtual int32_t getRangeCount() const;
1558+
int32_t getRangeCount() const;
15591559

15601560
/**
15611561
* Iteration method that returns the first character in the
@@ -1564,7 +1564,7 @@ class U_COMMON_API UnicodeSet final : public UnicodeFilter {
15641564
* @see #getRangeEnd
15651565
* @stable ICU 2.4
15661566
*/
1567-
virtual UChar32 getRangeStart(int32_t index) const;
1567+
UChar32 getRangeStart(int32_t index) const;
15681568

15691569
/**
15701570
* Iteration method that returns the last character in the
@@ -1573,7 +1573,7 @@ class U_COMMON_API UnicodeSet final : public UnicodeFilter {
15731573
* @see #getRangeEnd
15741574
* @stable ICU 2.4
15751575
*/
1576-
virtual UChar32 getRangeEnd(int32_t index) const;
1576+
UChar32 getRangeEnd(int32_t index) const;
15771577

15781578
/**
15791579
* Serializes this set into an array of 16-bit integers. Serialization
@@ -1631,7 +1631,7 @@ class U_COMMON_API UnicodeSet final : public UnicodeFilter {
16311631
* A frozen set will not be modified.
16321632
* @stable ICU 2.4
16331633
*/
1634-
virtual UnicodeSet& compact();
1634+
UnicodeSet& compact();
16351635

16361636
/**
16371637
* Return the class ID for this class. This is useful only for

icu4c/source/i18n/unicode/dtitvinf.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,13 @@ class U_I18N_API DateIntervalInfo final : public UObject {
197197
* @return a copy of the object
198198
* @stable ICU 4.0
199199
*/
200-
virtual DateIntervalInfo* clone() const;
200+
DateIntervalInfo* clone() const;
201201

202202
/**
203203
* Destructor.
204-
* It is virtual to be safe, but it is not designed to be subclassed.
205204
* @stable ICU 4.0
206205
*/
207-
virtual ~DateIntervalInfo();
206+
~DateIntervalInfo();
208207

209208

210209
/**
@@ -214,7 +213,7 @@ class U_I18N_API DateIntervalInfo final : public UObject {
214213
* @return true if other is semantically equal to this.
215214
* @stable ICU 4.0
216215
*/
217-
virtual bool operator==(const DateIntervalInfo& other) const;
216+
bool operator==(const DateIntervalInfo& other) const;
218217

219218
/**
220219
* Return true if another object is semantically unequal to this one.

0 commit comments

Comments
 (0)