Rename Compare -> Comparator to resolve name conflict in v8::internal

Review URL: http://codereview.chromium.org/1737009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4520 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
peter.rybin@gmail.com 2010-04-27 21:20:02 +00:00
parent c690c2ba77
commit 6684b3c5d3
3 changed files with 14 additions and 14 deletions

View File

@ -49,7 +49,7 @@ namespace internal {
// that helps building the chunk list.
class Differencer {
public:
explicit Differencer(Compare::Input* input)
explicit Differencer(Comparator::Input* input)
: input_(input), len1_(input->getLength1()), len2_(input->getLength2()) {
buffer_ = NewArray<int>(len1_ * len2_);
}
@ -70,7 +70,7 @@ class Differencer {
CompareUpToTail(0, 0);
}
void SaveResult(Compare::Output* chunk_writer) {
void SaveResult(Comparator::Output* chunk_writer) {
ResultWriter writer(chunk_writer);
int pos1 = 0;
@ -112,7 +112,7 @@ class Differencer {
}
private:
Compare::Input* input_;
Comparator::Input* input_;
int* buffer_;
int len1_;
int len2_;
@ -195,7 +195,7 @@ class Differencer {
class ResultWriter {
public:
explicit ResultWriter(Compare::Output* chunk_writer)
explicit ResultWriter(Comparator::Output* chunk_writer)
: chunk_writer_(chunk_writer), pos1_(0), pos2_(0),
pos1_begin_(-1), pos2_begin_(-1), has_open_chunk_(false) {
}
@ -217,7 +217,7 @@ class Differencer {
}
private:
Compare::Output* chunk_writer_;
Comparator::Output* chunk_writer_;
int pos1_;
int pos2_;
int pos1_begin_;
@ -243,8 +243,8 @@ class Differencer {
};
void Compare::CalculateDifference(Compare::Input* input,
Compare::Output* result_writer) {
void Comparator::CalculateDifference(Comparator::Input* input,
Comparator::Output* result_writer) {
Differencer differencer(input);
differencer.Initialize();
differencer.FillTable();
@ -312,7 +312,7 @@ class LineEndsWrapper {
// Represents 2 strings as 2 arrays of lines.
class LineArrayCompareInput : public Compare::Input {
class LineArrayCompareInput : public Comparator::Input {
public:
LineArrayCompareInput(Handle<String> s1, Handle<String> s2,
LineEndsWrapper line_ends1, LineEndsWrapper line_ends2)
@ -347,7 +347,7 @@ class LineArrayCompareInput : public Compare::Input {
// Stores compare result in JSArray. Each chunk is stored as 3 array elements:
// (pos1_begin, pos1_end, pos2_end).
class LineArrayCompareOutput : public Compare::Output {
class LineArrayCompareOutput : public Comparator::Output {
public:
LineArrayCompareOutput(LineEndsWrapper line_ends1, LineEndsWrapper line_ends2)
: array_(Factory::NewJSArray(10)), current_size_(0),
@ -388,7 +388,7 @@ Handle<JSArray> LiveEdit::CompareStringsLinewise(Handle<String> s1,
LineArrayCompareInput input(s1, s2, line_ends1, line_ends2);
LineArrayCompareOutput output(line_ends1, line_ends2);
Compare::CalculateDifference(&input, &output);
Comparator::CalculateDifference(&input, &output);
return output.GetResult();
}

View File

@ -118,7 +118,7 @@ class LiveEdit : AllStatic {
// A general-purpose comparator between 2 arrays.
class Compare {
class Comparator {
public:
// Holds 2 arrays of some elements allowing to compare any pair of

View File

@ -38,7 +38,7 @@ using namespace v8::internal;
// Anonymous namespace.
namespace {
class StringCompareInput : public Compare::Input {
class StringCompareInput : public Comparator::Input {
public:
StringCompareInput(const char* s1, const char* s2) : s1_(s1), s2_(s2) {
}
@ -72,7 +72,7 @@ class DiffChunkStruct : public ZoneObject {
};
class ListDiffOutputWriter : public Compare::Output {
class ListDiffOutputWriter : public Comparator::Output {
public:
explicit ListDiffOutputWriter(DiffChunkStruct** next_chunk_pointer)
: next_chunk_pointer_(next_chunk_pointer) {
@ -98,7 +98,7 @@ void CompareStringsOneWay(const char* s1, const char* s2,
DiffChunkStruct* first_chunk;
ListDiffOutputWriter writer(&first_chunk);
Compare::CalculateDifference(&input, &writer);
Comparator::CalculateDifference(&input, &writer);
int len1 = StrLength(s1);
int len2 = StrLength(s2);