Commit 0a53977d authored by Florian Sattler's avatar Florian Sattler Committed by Commit Bot

[cleanup] Refactor objects to use default members.

Fixing clang-tidy warning.

Bug: v8:8015
Change-Id: Ie0591d8f32ebd4b9681ef9eeec092e30b73bd0b8
Reviewed-on: https://chromium-review.googlesource.com/1224172Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Florian Sattler <sattlerf@google.com>
Cr-Commit-Position: refs/heads/master@{#55902}
parent 09ab629d
...@@ -244,7 +244,7 @@ class HashTableKey { ...@@ -244,7 +244,7 @@ class HashTableKey {
virtual bool IsMatch(Object* other) = 0; virtual bool IsMatch(Object* other) = 0;
// Returns the hash value for this key. // Returns the hash value for this key.
// Required. // Required.
virtual ~HashTableKey() {} virtual ~HashTableKey() = default;
uint32_t Hash() const { return hash_; } uint32_t Hash() const { return hash_; }
......
...@@ -33,7 +33,7 @@ class PatternMap { ...@@ -33,7 +33,7 @@ class PatternMap {
public: public:
PatternMap(std::string pattern, std::string value) PatternMap(std::string pattern, std::string value)
: pattern(pattern), value(value) {} : pattern(pattern), value(value) {}
virtual ~PatternMap() {} virtual ~PatternMap() = default;
std::string pattern; std::string pattern;
std::string value; std::string value;
}; };
...@@ -43,7 +43,7 @@ class PatternItem { ...@@ -43,7 +43,7 @@ class PatternItem {
PatternItem(const std::string property, std::vector<PatternMap> pairs, PatternItem(const std::string property, std::vector<PatternMap> pairs,
std::vector<const char*>* allowed_values) std::vector<const char*>* allowed_values)
: property(property), pairs(pairs), allowed_values(allowed_values) {} : property(property), pairs(pairs), allowed_values(allowed_values) {}
virtual ~PatternItem() {} virtual ~PatternItem() = default;
const std::string property; const std::string property;
// It is important for the pattern in the pairs from longer one to shorter one // It is important for the pattern in the pairs from longer one to shorter one
...@@ -107,7 +107,7 @@ class PatternData { ...@@ -107,7 +107,7 @@ class PatternData {
map.insert(std::make_pair(pair.value, pair.pattern)); map.insert(std::make_pair(pair.value, pair.pattern));
} }
} }
virtual ~PatternData() {} virtual ~PatternData() = default;
const std::string property; const std::string property;
std::map<const std::string, const std::string> map; std::map<const std::string, const std::string> map;
......
...@@ -123,7 +123,7 @@ struct NumberFormatSpan { ...@@ -123,7 +123,7 @@ struct NumberFormatSpan {
int32_t begin_pos; int32_t begin_pos;
int32_t end_pos; int32_t end_pos;
NumberFormatSpan() {} NumberFormatSpan() = default;
NumberFormatSpan(int32_t field_id, int32_t begin_pos, int32_t end_pos) NumberFormatSpan(int32_t field_id, int32_t begin_pos, int32_t end_pos)
: field_id(field_id), begin_pos(begin_pos), end_pos(end_pos) {} : field_id(field_id), begin_pos(begin_pos), end_pos(end_pos) {}
}; };
......
...@@ -742,8 +742,7 @@ class String::SubStringRange::iterator final { ...@@ -742,8 +742,7 @@ class String::SubStringRange::iterator final {
typedef uc16* pointer; typedef uc16* pointer;
typedef uc16& reference; typedef uc16& reference;
iterator(const iterator& other) iterator(const iterator& other) = default;
: content_(other.content_), offset_(other.offset_) {}
uc16 operator*() { return content_.Get(offset_); } uc16 operator*() { return content_.Get(offset_); }
bool operator==(const iterator& other) const { bool operator==(const iterator& other) const {
......
...@@ -264,7 +264,7 @@ class String : public Name { ...@@ -264,7 +264,7 @@ class String : public Name {
virtual MaybeHandle<String> GetNamedCapture(Handle<String> name, virtual MaybeHandle<String> GetNamedCapture(Handle<String> name,
CaptureState* state) = 0; CaptureState* state) = 0;
virtual ~Match() {} virtual ~Match() = default;
}; };
// ES#sec-getsubstitution // ES#sec-getsubstitution
...@@ -846,7 +846,7 @@ class FlatStringReader : public Relocatable { ...@@ -846,7 +846,7 @@ class FlatStringReader : public Relocatable {
// traversal of the entire string // traversal of the entire string
class ConsStringIterator { class ConsStringIterator {
public: public:
inline ConsStringIterator() {} inline ConsStringIterator() = default;
inline explicit ConsStringIterator(ConsString* cons_string, int offset = 0) { inline explicit ConsStringIterator(ConsString* cons_string, int offset = 0) {
Reset(cons_string, offset); Reset(cons_string, offset);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment