You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2011/04/02 18:04:29 UTC
[lucy-commits] svn commit: r1088055 - in /incubator/lucy/trunk: clownfish/t/
core/Lucy/Analysis/ core/Lucy/Document/ core/Lucy/Index/ core/Lucy/Object/
core/Lucy/Plan/ core/Lucy/Search/ core/Lucy/Store/ core/Lucy/Test/Object/
core/Lucy/Test/Search/ core/LucyX/Search/...
Author: marvin
Date: Sat Apr 2 16:04:28 2011
New Revision: 1088055
URL: http://svn.apache.org/viewvc?rev=1088055&view=rev
Log:
Swap out a frivolous variable name for something shorter and clearer to
non-native English spearkers.
Modified:
incubator/lucy/trunk/clownfish/t/107-arbitrary_type.t
incubator/lucy/trunk/core/Lucy/Analysis/CaseFolder.c
incubator/lucy/trunk/core/Lucy/Analysis/PolyAnalyzer.c
incubator/lucy/trunk/core/Lucy/Analysis/RegexTokenizer.c
incubator/lucy/trunk/core/Lucy/Analysis/SnowballStemmer.c
incubator/lucy/trunk/core/Lucy/Analysis/SnowballStopFilter.c
incubator/lucy/trunk/core/Lucy/Document/HitDoc.c
incubator/lucy/trunk/core/Lucy/Index/TermInfo.c
incubator/lucy/trunk/core/Lucy/Index/TermVector.c
incubator/lucy/trunk/core/Lucy/Object/BitVector.c
incubator/lucy/trunk/core/Lucy/Object/ByteBuf.c
incubator/lucy/trunk/core/Lucy/Object/CharBuf.c
incubator/lucy/trunk/core/Lucy/Object/Hash.c
incubator/lucy/trunk/core/Lucy/Object/Num.c
incubator/lucy/trunk/core/Lucy/Object/VArray.c
incubator/lucy/trunk/core/Lucy/Object/VTable.c
incubator/lucy/trunk/core/Lucy/Plan/Architecture.c
incubator/lucy/trunk/core/Lucy/Plan/BlobType.c
incubator/lucy/trunk/core/Lucy/Plan/FieldType.c
incubator/lucy/trunk/core/Lucy/Plan/FullTextType.c
incubator/lucy/trunk/core/Lucy/Plan/Schema.c
incubator/lucy/trunk/core/Lucy/Plan/StringType.c
incubator/lucy/trunk/core/Lucy/Search/Compiler.c
incubator/lucy/trunk/core/Lucy/Search/LeafQuery.c
incubator/lucy/trunk/core/Lucy/Search/MatchAllQuery.c
incubator/lucy/trunk/core/Lucy/Search/NoMatchQuery.c
incubator/lucy/trunk/core/Lucy/Search/PhraseQuery.c
incubator/lucy/trunk/core/Lucy/Search/PolyQuery.c
incubator/lucy/trunk/core/Lucy/Search/RangeQuery.c
incubator/lucy/trunk/core/Lucy/Search/TermQuery.c
incubator/lucy/trunk/core/Lucy/Store/InStream.c
incubator/lucy/trunk/core/Lucy/Test/Object/TestBitVector.c
incubator/lucy/trunk/core/Lucy/Test/Object/TestByteBuf.c
incubator/lucy/trunk/core/Lucy/Test/Object/TestVArray.c
incubator/lucy/trunk/core/Lucy/Test/Search/TestPhraseQuery.c
incubator/lucy/trunk/core/LucyX/Search/ProximityQuery.c
incubator/lucy/trunk/perl/t/504-similarity.t
incubator/lucy/trunk/perl/t/binding/016-varray.t
incubator/lucy/trunk/perl/t/binding/019-obj.t
incubator/lucy/trunk/perl/xs/Lucy/Document/Doc.c
Modified: incubator/lucy/trunk/clownfish/t/107-arbitrary_type.t
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/t/107-arbitrary_type.t?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/t/107-arbitrary_type.t (original)
+++ incubator/lucy/trunk/clownfish/t/107-arbitrary_type.t Sat Apr 2 16:04:28 2011
@@ -35,11 +35,11 @@ is( $compare_t_type->get_specifier,
"neato_Sort_compare_t", "Prepend prefix to specifier" );
is( $compare_t_type->to_c, "neato_Sort_compare_t", "to_c" );
-my $evil_twin = Clownfish::Type->new_arbitrary(
+my $twin = Clownfish::Type->new_arbitrary(
parcel => 'Neato',
specifier => "foo_t",
);
-ok( $foo_type->equals($evil_twin), "equals" );
+ok( $foo_type->equals($twin), "equals" );
ok( !$foo_type->equals($compare_t_type),
"equals spoiled by different specifier"
);
Modified: incubator/lucy/trunk/core/Lucy/Analysis/CaseFolder.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Analysis/CaseFolder.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Analysis/CaseFolder.c (original)
+++ incubator/lucy/trunk/core/Lucy/Analysis/CaseFolder.c Sat Apr 2 16:04:28 2011
@@ -46,8 +46,8 @@ CaseFolder_destroy(CaseFolder *self)
bool_t
CaseFolder_equals(CaseFolder *self, Obj *other)
{
- CaseFolder *const evil_twin = (CaseFolder*)other;
- if (evil_twin == self) return true;
+ CaseFolder *const twin = (CaseFolder*)other;
+ if (twin == self) return true;
UNUSED_VAR(self);
if (!Obj_Is_A(other, CASEFOLDER)) return false;
return true;
Modified: incubator/lucy/trunk/core/Lucy/Analysis/PolyAnalyzer.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Analysis/PolyAnalyzer.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Analysis/PolyAnalyzer.c (original)
+++ incubator/lucy/trunk/core/Lucy/Analysis/PolyAnalyzer.c Sat Apr 2 16:04:28 2011
@@ -113,10 +113,10 @@ PolyAnalyzer_transform_text(PolyAnalyzer
bool_t
PolyAnalyzer_equals(PolyAnalyzer *self, Obj *other)
{
- PolyAnalyzer *const evil_twin = (PolyAnalyzer*)other;
- if (evil_twin == self) return true;
+ PolyAnalyzer *const twin = (PolyAnalyzer*)other;
+ if (twin == self) return true;
if (!Obj_Is_A(other, POLYANALYZER)) return false;
- if (!VA_Equals(evil_twin->analyzers, (Obj*)self->analyzers)) return false;
+ if (!VA_Equals(twin->analyzers, (Obj*)self->analyzers)) return false;
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Analysis/RegexTokenizer.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Analysis/RegexTokenizer.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Analysis/RegexTokenizer.c (original)
+++ incubator/lucy/trunk/core/Lucy/Analysis/RegexTokenizer.c Sat Apr 2 16:04:28 2011
@@ -77,10 +77,10 @@ RegexTokenizer_load(RegexTokenizer *self
bool_t
RegexTokenizer_equals(RegexTokenizer *self, Obj *other)
{
- RegexTokenizer *const evil_twin = (RegexTokenizer*)other;
- if (evil_twin == self) return true;
+ RegexTokenizer *const twin = (RegexTokenizer*)other;
+ if (twin == self) return true;
if (!Obj_Is_A(other, REGEXTOKENIZER)) return false;
- if (!CB_Equals(evil_twin->pattern, (Obj*)self->pattern)) return false;
+ if (!CB_Equals(twin->pattern, (Obj*)self->pattern)) return false;
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Analysis/SnowballStemmer.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Analysis/SnowballStemmer.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Analysis/SnowballStemmer.c (original)
+++ incubator/lucy/trunk/core/Lucy/Analysis/SnowballStemmer.c Sat Apr 2 16:04:28 2011
@@ -107,10 +107,10 @@ SnowStemmer_load(SnowballStemmer *self,
bool_t
SnowStemmer_equals(SnowballStemmer *self, Obj *other)
{
- SnowballStemmer *const evil_twin = (SnowballStemmer*)other;
- if (evil_twin == self) return true;
+ SnowballStemmer *const twin = (SnowballStemmer*)other;
+ if (twin == self) return true;
if (!Obj_Is_A(other, SNOWBALLSTEMMER)) return false;
- if (!CB_Equals(evil_twin->language, (Obj*)self->language)) return false;
+ if (!CB_Equals(twin->language, (Obj*)self->language)) return false;
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Analysis/SnowballStopFilter.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Analysis/SnowballStopFilter.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Analysis/SnowballStopFilter.c (original)
+++ incubator/lucy/trunk/core/Lucy/Analysis/SnowballStopFilter.c Sat Apr 2 16:04:28 2011
@@ -77,10 +77,10 @@ SnowStop_transform(SnowballStopFilter *s
bool_t
SnowStop_equals(SnowballStopFilter *self, Obj *other)
{
- SnowballStopFilter *const evil_twin = (SnowballStopFilter*)other;
- if (evil_twin == self) return true;
+ SnowballStopFilter *const twin = (SnowballStopFilter*)other;
+ if (twin == self) return true;
if (!Obj_Is_A(other, SNOWBALLSTOPFILTER)) return false;
- if (!Hash_Equals(evil_twin->stoplist, (Obj*)self->stoplist)) {
+ if (!Hash_Equals(twin->stoplist, (Obj*)self->stoplist)) {
return false;
}
return true;
Modified: incubator/lucy/trunk/core/Lucy/Document/HitDoc.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Document/HitDoc.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Document/HitDoc.c (original)
+++ incubator/lucy/trunk/core/Lucy/Document/HitDoc.c Sat Apr 2 16:04:28 2011
@@ -80,11 +80,11 @@ HitDoc_load(HitDoc *self, Obj *dump)
bool_t
HitDoc_equals(HitDoc *self, Obj *other)
{
- HitDoc *evil_twin = (HitDoc*)other;
- if (evil_twin == self) { return true; }
+ HitDoc *twin = (HitDoc*)other;
+ if (twin == self) { return true; }
if (!Obj_Is_A(other, HITDOC)) { return false; }
if (!Doc_equals((Doc*)self, other)) { return false; }
- if (self->score != evil_twin->score) { return false; }
+ if (self->score != twin->score) { return false; }
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Index/TermInfo.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Index/TermInfo.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Index/TermInfo.c (original)
+++ incubator/lucy/trunk/core/Lucy/Index/TermInfo.c Sat Apr 2 16:04:28 2011
@@ -40,11 +40,11 @@ TInfo_init(TermInfo *self, int32_t doc_f
TermInfo*
TInfo_clone(TermInfo *self)
{
- TermInfo *evil_twin = TInfo_new(self->doc_freq);
- evil_twin->post_filepos = self->post_filepos;
- evil_twin->skip_filepos = self->skip_filepos;
- evil_twin->lex_filepos = self->lex_filepos;
- return evil_twin;
+ TermInfo *twin = TInfo_new(self->doc_freq);
+ twin->post_filepos = self->post_filepos;
+ twin->skip_filepos = self->skip_filepos;
+ twin->lex_filepos = self->lex_filepos;
+ return twin;
}
int32_t
@@ -87,11 +87,11 @@ TInfo_to_string(TermInfo *self)
void
TInfo_mimic(TermInfo *self, Obj *other)
{
- TermInfo *evil_twin = (TermInfo*)CERTIFY(other, TERMINFO);
- self->doc_freq = evil_twin->doc_freq;
- self->post_filepos = evil_twin->post_filepos;
- self->skip_filepos = evil_twin->skip_filepos;
- self->lex_filepos = evil_twin->lex_filepos;
+ TermInfo *twin = (TermInfo*)CERTIFY(other, TERMINFO);
+ self->doc_freq = twin->doc_freq;
+ self->post_filepos = twin->post_filepos;
+ self->skip_filepos = twin->skip_filepos;
+ self->lex_filepos = twin->lex_filepos;
}
void
Modified: incubator/lucy/trunk/core/Lucy/Index/TermVector.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Index/TermVector.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Index/TermVector.c (original)
+++ incubator/lucy/trunk/core/Lucy/Index/TermVector.c Sat Apr 2 16:04:28 2011
@@ -127,20 +127,20 @@ TV_deserialize(TermVector *self, InStrea
bool_t
TV_equals(TermVector *self, Obj *other)
{
- TermVector *const evil_twin = (TermVector*)other;
+ TermVector *const twin = (TermVector*)other;
uint32_t i;
int32_t *const posits = self->positions->ints;
int32_t *const starts = self->start_offsets->ints;
int32_t *const ends = self->start_offsets->ints;
- int32_t *const other_posits = evil_twin->positions->ints;
- int32_t *const other_starts = evil_twin->start_offsets->ints;
- int32_t *const other_ends = evil_twin->start_offsets->ints;
-
- if (evil_twin == self) return true;
-
- if (!CB_Equals(self->field, (Obj*)evil_twin->field)) return false;
- if (!CB_Equals(self->text, (Obj*)evil_twin->text)) return false;
- if (self->num_pos != evil_twin->num_pos) return false;
+ int32_t *const other_posits = twin->positions->ints;
+ int32_t *const other_starts = twin->start_offsets->ints;
+ int32_t *const other_ends = twin->start_offsets->ints;
+
+ if (twin == self) return true;
+
+ if (!CB_Equals(self->field, (Obj*)twin->field)) return false;
+ if (!CB_Equals(self->text, (Obj*)twin->text)) return false;
+ if (self->num_pos != twin->num_pos) return false;
for (i = 0; i < self->num_pos; i++) {
if (posits[i] != other_posits[i]) return false;
Modified: incubator/lucy/trunk/core/Lucy/Object/BitVector.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Object/BitVector.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Object/BitVector.c (original)
+++ incubator/lucy/trunk/core/Lucy/Object/BitVector.c Sat Apr 2 16:04:28 2011
@@ -81,7 +81,7 @@ BitVec_destroy(BitVector* self)
BitVector*
BitVec_clone(BitVector *self)
{
- BitVector *evil_twin = BitVec_new(self->cap);
+ BitVector *twin = BitVec_new(self->cap);
uint32_t byte_size = (uint32_t)ceil(self->cap / 8.0);
// Forbid inheritance.
@@ -90,9 +90,9 @@ BitVec_clone(BitVector *self)
BitVec_Get_Class_Name(self));
}
- memcpy(evil_twin->bits, self->bits, byte_size * sizeof(uint8_t));
+ memcpy(twin->bits, self->bits, byte_size * sizeof(uint8_t));
- return evil_twin;
+ return twin;
}
uint8_t*
@@ -103,17 +103,17 @@ BitVec_get_capacity(BitVector *self) { r
void
BitVec_mimic(BitVector *self, Obj *other)
{
- BitVector *evil_twin = (BitVector*)CERTIFY(other, BITVECTOR);
+ BitVector *twin = (BitVector*)CERTIFY(other, BITVECTOR);
const uint32_t my_byte_size = (uint32_t)ceil(self->cap / 8.0);
- const uint32_t evil_twin_byte_size = (uint32_t)ceil(evil_twin->cap / 8.0);
- if (my_byte_size > evil_twin_byte_size) {
- uint32_t space = my_byte_size - evil_twin_byte_size;
- memset(self->bits + evil_twin_byte_size, 0, space);
+ const uint32_t twin_byte_size = (uint32_t)ceil(twin->cap / 8.0);
+ if (my_byte_size > twin_byte_size) {
+ uint32_t space = my_byte_size - twin_byte_size;
+ memset(self->bits + twin_byte_size, 0, space);
}
- else if (my_byte_size < evil_twin_byte_size) {
- BitVec_Grow(self, evil_twin->cap - 1);
+ else if (my_byte_size < twin_byte_size) {
+ BitVec_Grow(self, twin->cap - 1);
}
- memcpy(self->bits, evil_twin->bits, evil_twin_byte_size);
+ memcpy(self->bits, twin->bits, twin_byte_size);
}
void
Modified: incubator/lucy/trunk/core/Lucy/Object/ByteBuf.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Object/ByteBuf.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Object/ByteBuf.c (original)
+++ incubator/lucy/trunk/core/Lucy/Object/ByteBuf.c Sat Apr 2 16:04:28 2011
@@ -112,10 +112,10 @@ SI_equals_bytes(ByteBuf *self, const voi
bool_t
BB_equals(ByteBuf *self, Obj *other)
{
- ByteBuf *const evil_twin = (ByteBuf*)other;
- if (evil_twin == self) return true;
+ ByteBuf *const twin = (ByteBuf*)other;
+ if (twin == self) return true;
if (!Obj_Is_A(other, BYTEBUF)) return false;
- return SI_equals_bytes(self, evil_twin->buf, evil_twin->size);
+ return SI_equals_bytes(self, twin->buf, twin->size);
}
bool_t
@@ -154,8 +154,8 @@ BB_mimic_bytes(ByteBuf *self, const void
void
BB_mimic(ByteBuf *self, Obj *other)
{
- ByteBuf *evil_twin = (ByteBuf*)CERTIFY(other, BYTEBUF);
- SI_mimic_bytes(self, evil_twin->buf, evil_twin->size);
+ ByteBuf *twin = (ByteBuf*)CERTIFY(other, BYTEBUF);
+ SI_mimic_bytes(self, twin->buf, twin->size);
}
static INLINE void
Modified: incubator/lucy/trunk/core/Lucy/Object/CharBuf.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Object/CharBuf.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Object/CharBuf.c (original)
+++ incubator/lucy/trunk/core/Lucy/Object/CharBuf.c Sat Apr 2 16:04:28 2011
@@ -522,11 +522,11 @@ CB_mimic_str(CharBuf *self, const char*
void
CB_mimic(CharBuf *self, Obj *other)
{
- CharBuf *evil_twin = (CharBuf*)CERTIFY(other, CHARBUF);
- if (evil_twin->size >= self->cap) { S_grow(self, evil_twin->size); }
- memmove(self->ptr, evil_twin->ptr, evil_twin->size);
- self->size = evil_twin->size;
- self->ptr[evil_twin->size] = '\0';
+ CharBuf *twin = (CharBuf*)CERTIFY(other, CHARBUF);
+ if (twin->size >= self->cap) { S_grow(self, twin->size); }
+ memmove(self->ptr, twin->ptr, twin->size);
+ self->size = twin->size;
+ self->ptr[twin->size] = '\0';
}
void
@@ -585,10 +585,10 @@ CB_starts_with_str(CharBuf *self, const
bool_t
CB_equals(CharBuf *self, Obj *other)
{
- CharBuf *const evil_twin = (CharBuf*)other;
- if (evil_twin == self) return true;
+ CharBuf *const twin = (CharBuf*)other;
+ if (twin == self) return true;
if (!Obj_Is_A(other, CHARBUF)) return false;
- return CB_equals_str(self, evil_twin->ptr, evil_twin->size);
+ return CB_equals_str(self, twin->ptr, twin->size);
}
int32_t
Modified: incubator/lucy/trunk/core/Lucy/Object/Hash.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Object/Hash.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Object/Hash.c (original)
+++ incubator/lucy/trunk/core/Lucy/Object/Hash.c Sat Apr 2 16:04:28 2011
@@ -451,17 +451,17 @@ Hash_values(Hash *self)
bool_t
Hash_equals(Hash *self, Obj *other)
{
- Hash *evil_twin = (Hash*)other;
+ Hash *twin = (Hash*)other;
Obj *key;
Obj *val;
- if (evil_twin == self) return true;
+ if (twin == self) return true;
if (!Obj_Is_A(other, HASH)) return false;
- if (self->size != evil_twin->size) return false;
+ if (self->size != twin->size) return false;
Hash_Iterate(self);
while (Hash_Next(self, &key, &val)) {
- Obj *other_val = Hash_Fetch(evil_twin, key);
+ Obj *other_val = Hash_Fetch(twin, key);
if (!other_val || !Obj_Equals(other_val, val)) return false;
}
Modified: incubator/lucy/trunk/core/Lucy/Object/Num.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Object/Num.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Object/Num.c (original)
+++ incubator/lucy/trunk/core/Lucy/Object/Num.c Sat Apr 2 16:04:28 2011
@@ -41,25 +41,25 @@ Num_init(Num *self)
bool_t
Num_equals(Num *self, Obj *other)
{
- Num *evil_twin = (Num*)other;
- if (evil_twin == self) { return true; }
+ Num *twin = (Num*)other;
+ if (twin == self) { return true; }
if (!Obj_Is_A(other, NUM)) { return false; }
- if (Num_To_F64(self) != Num_To_F64(evil_twin)) { return false; }
- if (Num_To_I64(self) != Num_To_I64(evil_twin)) { return false; }
+ if (Num_To_F64(self) != Num_To_F64(twin)) { return false; }
+ if (Num_To_I64(self) != Num_To_I64(twin)) { return false; }
return true;
}
int32_t
Num_compare_to(Num *self, Obj *other)
{
- Num *evil_twin = (Num*)CERTIFY(other, NUM);
- double f64_diff = Num_To_F64(self) - Num_To_F64(evil_twin);
+ Num *twin = (Num*)CERTIFY(other, NUM);
+ double f64_diff = Num_To_F64(self) - Num_To_F64(twin);
if (f64_diff) {
if (f64_diff < 0) { return -1; }
else if (f64_diff > 0) { return 1; }
}
else {
- int64_t i64_diff = Num_To_I64(self) - Num_To_I64(evil_twin);
+ int64_t i64_diff = Num_To_I64(self) - Num_To_I64(twin);
if (i64_diff) {
if (i64_diff < 0) { return -1; }
else if (i64_diff > 0) { return 1; }
@@ -146,8 +146,8 @@ Float32_clone(Float32 *self)
void
Float32_mimic(Float32 *self, Obj *other)
{
- Float32 *evil_twin = (Float32*)CERTIFY(other, FLOAT32);
- self->value = evil_twin->value;
+ Float32 *twin = (Float32*)CERTIFY(other, FLOAT32);
+ self->value = twin->value;
}
void
@@ -205,8 +205,8 @@ Float64_clone(Float64 *self)
void
Float64_mimic(Float64 *self, Obj *other)
{
- Float64 *evil_twin = (Float64*)CERTIFY(other, FLOAT64);
- self->value = evil_twin->value;
+ Float64 *twin = (Float64*)CERTIFY(other, FLOAT64);
+ self->value = twin->value;
}
int32_t
@@ -271,8 +271,8 @@ Int32_clone(Integer32 *self)
void
Int32_mimic(Integer32 *self, Obj *other)
{
- Integer32 *evil_twin = (Integer32*)CERTIFY(other, INTEGER32);
- self->value = evil_twin->value;
+ Integer32 *twin = (Integer32*)CERTIFY(other, INTEGER32);
+ self->value = twin->value;
}
int32_t
@@ -336,8 +336,8 @@ Int64_clone(Integer64 *self)
void
Int64_mimic(Integer64 *self, Obj *other)
{
- Integer64 *evil_twin = (Integer64*)CERTIFY(other, INTEGER64);
- self->value = evil_twin->value;
+ Integer64 *twin = (Integer64*)CERTIFY(other, INTEGER64);
+ self->value = twin->value;
}
int32_t
@@ -350,17 +350,17 @@ Int64_hash_sum(Integer64 *self)
bool_t
Int64_equals(Integer64 *self, Obj *other)
{
- Num *evil_twin = (Num*)other;
- if (evil_twin == (Num*)self) { return true; }
+ Num *twin = (Num*)other;
+ if (twin == (Num*)self) { return true; }
if (!Obj_Is_A(other, NUM)) { return false; }
- if (Num_Is_A(evil_twin, FLOATNUM)) {
- double floating_val = Num_To_F64(evil_twin);
+ if (Num_Is_A(twin, FLOATNUM)) {
+ double floating_val = Num_To_F64(twin);
int64_t int_val = (int64_t)floating_val;
if ((double)int_val != floating_val) { return false; }
if (int_val != self->value) { return false; }
}
else {
- if (self->value != Num_To_I64(evil_twin)) { return false; }
+ if (self->value != Num_To_I64(twin)) { return false; }
}
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Object/VArray.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Object/VArray.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Object/VArray.c (original)
+++ incubator/lucy/trunk/core/Lucy/Object/VArray.c Sat Apr 2 16:04:28 2011
@@ -141,40 +141,40 @@ VArray*
VA_clone(VArray *self)
{
uint32_t i;
- VArray *evil_twin = VA_new(self->size);
+ VArray *twin = VA_new(self->size);
// Clone each element.
for (i = 0; i < self->size; i++) {
Obj *elem = self->elems[i];
if (elem) {
- evil_twin->elems[i] = Obj_Clone(elem);
+ twin->elems[i] = Obj_Clone(elem);
}
}
// Ensure that size is the same if NULL elems at end.
- evil_twin->size = self->size;
+ twin->size = self->size;
- return evil_twin;
+ return twin;
}
VArray*
VA_shallow_copy(VArray *self)
{
uint32_t i;
- VArray *evil_twin;
+ VArray *twin;
Obj **elems;
// Dupe, then increment refcounts.
- evil_twin = VA_new(self->size);
- elems = evil_twin->elems;
+ twin = VA_new(self->size);
+ elems = twin->elems;
memcpy(elems, self->elems, self->size * sizeof(Obj*));
- evil_twin->size = self->size;
+ twin->size = self->size;
for (i = 0; i < self->size; i++) {
if (elems[i] != NULL)
(void)INCREF(elems[i]);
}
- return evil_twin;
+ return twin;
}
void
@@ -348,17 +348,17 @@ VA_sort(VArray *self, lucy_Sort_compare_
bool_t
VA_equals(VArray *self, Obj *other)
{
- VArray *evil_twin = (VArray*)other;
- if (evil_twin == self) return true;
+ VArray *twin = (VArray*)other;
+ if (twin == self) return true;
if (!Obj_Is_A(other, VARRAY)) return false;
- if (evil_twin->size != self->size) {
+ if (twin->size != self->size) {
return false;
}
else {
uint32_t i, max;
for (i = 0, max = self->size; i < max; i++) {
Obj *val = self->elems[i];
- Obj *other_val = evil_twin->elems[i];
+ Obj *other_val = twin->elems[i];
if ((val && !other_val) || (other_val && !val)) return false;
if (val && !Obj_Equals(val, other_val)) return false;
}
Modified: incubator/lucy/trunk/core/Lucy/Object/VTable.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Object/VTable.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Object/VTable.c (original)
+++ incubator/lucy/trunk/core/Lucy/Object/VTable.c Sat Apr 2 16:04:28 2011
@@ -48,14 +48,14 @@ VTable_destroy(VTable *self)
VTable*
VTable_clone(VTable *self)
{
- VTable *evil_twin
+ VTable *twin
= (VTable*)Memory_wrapped_calloc(self->vt_alloc_size, 1);
- memcpy(evil_twin, self, self->vt_alloc_size);
- evil_twin->name = CB_Clone(self->name);
- evil_twin->ref.count = 1;
+ memcpy(twin, self, self->vt_alloc_size);
+ twin->name = CB_Clone(self->name);
+ twin->ref.count = 1;
- return evil_twin;
+ return twin;
}
Obj*
Modified: incubator/lucy/trunk/core/Lucy/Plan/Architecture.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Plan/Architecture.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Plan/Architecture.c (original)
+++ incubator/lucy/trunk/core/Lucy/Plan/Architecture.c Sat Apr 2 16:04:28 2011
@@ -55,8 +55,8 @@ Arch_init(Architecture *self)
bool_t
Arch_equals(Architecture *self, Obj *other)
{
- Architecture *evil_twin = (Architecture*)other;
- if (evil_twin == self) return true;
+ Architecture *twin = (Architecture*)other;
+ if (twin == self) return true;
if (!Obj_Is_A(other, ARCHITECTURE)) return false;
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Plan/BlobType.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Plan/BlobType.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Plan/BlobType.c (original)
+++ incubator/lucy/trunk/core/Lucy/Plan/BlobType.c Sat Apr 2 16:04:28 2011
@@ -65,8 +65,8 @@ BlobType_primitive_id(BlobType *self)
bool_t
BlobType_equals(BlobType *self, Obj *other)
{
- BlobType *evil_twin = (BlobType*)other;
- if (evil_twin == self) return true;
+ BlobType *twin = (BlobType*)other;
+ if (twin == self) return true;
if (!Obj_Is_A(other, BLOBTYPE)) return false;
return FType_equals((FieldType*)self, other);
}
Modified: incubator/lucy/trunk/core/Lucy/Plan/FieldType.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Plan/FieldType.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Plan/FieldType.c (original)
+++ incubator/lucy/trunk/core/Lucy/Plan/FieldType.c Sat Apr 2 16:04:28 2011
@@ -85,14 +85,14 @@ FType_compare_values(FieldType *self, Ob
bool_t
FType_equals(FieldType *self, Obj *other)
{
- FieldType *evil_twin = (FieldType*)other;
- if (evil_twin == self) return true;
- if (FType_Get_VTable(self) != FType_Get_VTable(evil_twin)) return false;
- if (self->boost != evil_twin->boost) return false;
- if (!!self->indexed != !!evil_twin->indexed) return false;
- if (!!self->stored != !!evil_twin->stored) return false;
- if (!!self->sortable != !!evil_twin->sortable) return false;
- if (!!FType_Binary(self) != !!FType_Binary(evil_twin)) return false;
+ FieldType *twin = (FieldType*)other;
+ if (twin == self) return true;
+ if (FType_Get_VTable(self) != FType_Get_VTable(twin)) return false;
+ if (self->boost != twin->boost) return false;
+ if (!!self->indexed != !!twin->indexed) return false;
+ if (!!self->stored != !!twin->stored) return false;
+ if (!!self->sortable != !!twin->sortable) return false;
+ if (!!FType_Binary(self) != !!FType_Binary(twin)) return false;
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Plan/FullTextType.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Plan/FullTextType.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Plan/FullTextType.c (original)
+++ incubator/lucy/trunk/core/Lucy/Plan/FullTextType.c Sat Apr 2 16:04:28 2011
@@ -63,13 +63,13 @@ FullTextType_destroy(FullTextType *self)
bool_t
FullTextType_equals(FullTextType *self, Obj *other)
{
- FullTextType *evil_twin = (FullTextType*)other;
- if (evil_twin == self) return true;
+ FullTextType *twin = (FullTextType*)other;
+ if (twin == self) return true;
if (!Obj_Is_A(other, FULLTEXTTYPE)) return false;
if (!FType_equals((FieldType*)self, other)) return false;
- if (!!self->sortable != !!evil_twin->sortable) return false;
- if (!!self->highlightable != !!evil_twin->highlightable) return false;
- if (!Analyzer_Equals(self->analyzer, (Obj*)evil_twin->analyzer)) {
+ if (!!self->sortable != !!twin->sortable) return false;
+ if (!!self->highlightable != !!twin->highlightable) return false;
+ if (!Analyzer_Equals(self->analyzer, (Obj*)twin->analyzer)) {
return false;
}
return true;
Modified: incubator/lucy/trunk/core/Lucy/Plan/Schema.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Plan/Schema.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Plan/Schema.c (original)
+++ incubator/lucy/trunk/core/Lucy/Plan/Schema.c Sat Apr 2 16:04:28 2011
@@ -100,12 +100,12 @@ S_add_unique(VArray *array, Obj *elem)
bool_t
Schema_equals(Schema *self, Obj *other)
{
- Schema *evil_twin = (Schema*)other;
- if (evil_twin == self) return true;
+ Schema *twin = (Schema*)other;
+ if (twin == self) return true;
if (!Obj_Is_A(other, SCHEMA)) return false;
- if (!Arch_Equals(self->arch, (Obj*)evil_twin->arch)) return false;
- if (!Sim_Equals(self->sim, (Obj*)evil_twin->sim)) return false;
- if (!Hash_Equals(self->types, (Obj*)evil_twin->types)) return false;
+ if (!Arch_Equals(self->arch, (Obj*)twin->arch)) return false;
+ if (!Sim_Equals(self->sim, (Obj*)twin->sim)) return false;
+ if (!Hash_Equals(self->types, (Obj*)twin->types)) return false;
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Plan/StringType.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Plan/StringType.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Plan/StringType.c (original)
+++ incubator/lucy/trunk/core/Lucy/Plan/StringType.c Sat Apr 2 16:04:28 2011
@@ -49,8 +49,8 @@ StringType_init2(StringType *self, float
bool_t
StringType_equals(StringType *self, Obj *other)
{
- StringType *evil_twin = (StringType*)other;
- if (evil_twin == self) return true;
+ StringType *twin = (StringType*)other;
+ if (twin == self) return true;
if (!FType_equals((FieldType*)self, other)) return false;
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Search/Compiler.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Search/Compiler.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Search/Compiler.c (original)
+++ incubator/lucy/trunk/core/Lucy/Search/Compiler.c Sat Apr 2 16:04:28 2011
@@ -115,12 +115,12 @@ Compiler_to_string(Compiler *self)
bool_t
Compiler_equals(Compiler *self, Obj *other)
{
- Compiler *evil_twin = (Compiler*)other;
- if (evil_twin == self) return true;
+ Compiler *twin = (Compiler*)other;
+ if (twin == self) return true;
if (!Obj_Is_A(other, COMPILER)) return false;
- if (self->boost != evil_twin->boost) return false;
- if (!Query_Equals(self->parent, (Obj*)evil_twin->parent)) return false;
- if (!Sim_Equals(self->sim, (Obj*)evil_twin->sim)) return false;
+ if (self->boost != twin->boost) return false;
+ if (!Query_Equals(self->parent, (Obj*)twin->parent)) return false;
+ if (!Sim_Equals(self->sim, (Obj*)twin->sim)) return false;
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Search/LeafQuery.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Search/LeafQuery.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Search/LeafQuery.c (original)
+++ incubator/lucy/trunk/core/Lucy/Search/LeafQuery.c Sat Apr 2 16:04:28 2011
@@ -55,15 +55,15 @@ LeafQuery_get_text(LeafQuery *self) { r
bool_t
LeafQuery_equals(LeafQuery *self, Obj *other)
{
- LeafQuery *evil_twin = (LeafQuery*)other;
- if (evil_twin == self) return true;
+ LeafQuery *twin = (LeafQuery*)other;
+ if (twin == self) return true;
if (!Obj_Is_A(other, LEAFQUERY)) return false;
- if (self->boost != evil_twin->boost) return false;
- if (!!self->field ^ !!evil_twin->field) return false;
+ if (self->boost != twin->boost) return false;
+ if (!!self->field ^ !!twin->field) return false;
if (self->field) {
- if (!CB_Equals(self->field, (Obj*)evil_twin->field)) return false;
+ if (!CB_Equals(self->field, (Obj*)twin->field)) return false;
}
- if (!CB_Equals(self->text, (Obj*)evil_twin->text)) return false;
+ if (!CB_Equals(self->text, (Obj*)twin->text)) return false;
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Search/MatchAllQuery.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Search/MatchAllQuery.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Search/MatchAllQuery.c (original)
+++ incubator/lucy/trunk/core/Lucy/Search/MatchAllQuery.c Sat Apr 2 16:04:28 2011
@@ -45,9 +45,9 @@ MatchAllQuery_init(MatchAllQuery *self)
bool_t
MatchAllQuery_equals(MatchAllQuery *self, Obj *other)
{
- MatchAllQuery *evil_twin = (MatchAllQuery*)other;
+ MatchAllQuery *twin = (MatchAllQuery*)other;
if (!Obj_Is_A(other, MATCHALLQUERY)) return false;
- if (self->boost != evil_twin->boost) return false;
+ if (self->boost != twin->boost) return false;
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Search/NoMatchQuery.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Search/NoMatchQuery.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Search/NoMatchQuery.c (original)
+++ incubator/lucy/trunk/core/Lucy/Search/NoMatchQuery.c Sat Apr 2 16:04:28 2011
@@ -45,10 +45,10 @@ NoMatchQuery_init(NoMatchQuery *self)
bool_t
NoMatchQuery_equals(NoMatchQuery *self, Obj *other)
{
- NoMatchQuery *evil_twin = (NoMatchQuery*)other;
+ NoMatchQuery *twin = (NoMatchQuery*)other;
if (!Obj_Is_A(other, NOMATCHQUERY)) return false;
- if (self->boost != evil_twin->boost) return false;
- if (!!self->fails_to_match != !!evil_twin->fails_to_match) return false;
+ if (self->boost != twin->boost) return false;
+ if (!!self->fails_to_match != !!twin->fails_to_match) return false;
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Search/PhraseQuery.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Search/PhraseQuery.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Search/PhraseQuery.c (original)
+++ incubator/lucy/trunk/core/Lucy/Search/PhraseQuery.c Sat Apr 2 16:04:28 2011
@@ -99,15 +99,15 @@ PhraseQuery_deserialize(PhraseQuery *sel
bool_t
PhraseQuery_equals(PhraseQuery *self, Obj *other)
{
- PhraseQuery *evil_twin = (PhraseQuery*)other;
- if (evil_twin == self) return true;
+ PhraseQuery *twin = (PhraseQuery*)other;
+ if (twin == self) return true;
if (!Obj_Is_A(other, PHRASEQUERY)) return false;
- if (self->boost != evil_twin->boost) return false;
- if (self->field && !evil_twin->field) return false;
- if (!self->field && evil_twin->field) return false;
- if (self->field && !CB_Equals(self->field, (Obj*)evil_twin->field))
+ if (self->boost != twin->boost) return false;
+ if (self->field && !twin->field) return false;
+ if (!self->field && twin->field) return false;
+ if (self->field && !CB_Equals(self->field, (Obj*)twin->field))
return false;
- if (!VA_Equals(evil_twin->terms, (Obj*)self->terms)) return false;
+ if (!VA_Equals(twin->terms, (Obj*)self->terms)) return false;
return true;
}
@@ -223,13 +223,13 @@ PhraseCompiler_deserialize(PhraseCompile
bool_t
PhraseCompiler_equals(PhraseCompiler *self, Obj *other)
{
- PhraseCompiler *evil_twin = (PhraseCompiler*)other;
+ PhraseCompiler *twin = (PhraseCompiler*)other;
if (!Obj_Is_A(other, PHRASECOMPILER)) return false;
if (!Compiler_equals((Compiler*)self, other)) return false;
- if (self->idf != evil_twin->idf) return false;
- if (self->raw_weight != evil_twin->raw_weight) return false;
- if (self->query_norm_factor != evil_twin->query_norm_factor) return false;
- if (self->normalized_weight != evil_twin->normalized_weight) return false;
+ if (self->idf != twin->idf) return false;
+ if (self->raw_weight != twin->raw_weight) return false;
+ if (self->query_norm_factor != twin->query_norm_factor) return false;
+ if (self->normalized_weight != twin->normalized_weight) return false;
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Search/PolyQuery.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Search/PolyQuery.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Search/PolyQuery.c (original)
+++ incubator/lucy/trunk/core/Lucy/Search/PolyQuery.c Sat Apr 2 16:04:28 2011
@@ -99,11 +99,11 @@ PolyQuery_deserialize(PolyQuery *self, I
bool_t
PolyQuery_equals(PolyQuery *self, Obj *other)
{
- PolyQuery *evil_twin = (PolyQuery*)other;
- if (evil_twin == self) return true;
+ PolyQuery *twin = (PolyQuery*)other;
+ if (twin == self) return true;
if (!Obj_Is_A(other, POLYQUERY)) return false;
- if (self->boost != evil_twin->boost) return false;
- if (!VA_Equals(evil_twin->children, (Obj*)self->children)) return false;
+ if (self->boost != twin->boost) return false;
+ if (!VA_Equals(twin->children, (Obj*)self->children)) return false;
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Search/RangeQuery.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Search/RangeQuery.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Search/RangeQuery.c (original)
+++ incubator/lucy/trunk/core/Lucy/Search/RangeQuery.c Sat Apr 2 16:04:28 2011
@@ -79,21 +79,21 @@ RangeQuery_destroy(RangeQuery *self)
bool_t
RangeQuery_equals(RangeQuery *self, Obj *other)
{
- RangeQuery *evil_twin = (RangeQuery*)other;
- if (evil_twin == self) return true;
+ RangeQuery *twin = (RangeQuery*)other;
+ if (twin == self) return true;
if (!Obj_Is_A(other, RANGEQUERY)) return false;
- if (self->boost != evil_twin->boost) return false;
- if (!CB_Equals(self->field, (Obj*)evil_twin->field)) return false;
- if (self->lower_term && !evil_twin->lower_term) return false;
- if (self->upper_term && !evil_twin->upper_term) return false;
- if (!self->lower_term && evil_twin->lower_term) return false;
- if (!self->upper_term && evil_twin->upper_term) return false;
+ if (self->boost != twin->boost) return false;
+ if (!CB_Equals(self->field, (Obj*)twin->field)) return false;
+ if (self->lower_term && !twin->lower_term) return false;
+ if (self->upper_term && !twin->upper_term) return false;
+ if (!self->lower_term && twin->lower_term) return false;
+ if (!self->upper_term && twin->upper_term) return false;
if ( self->lower_term
- && !Obj_Equals(self->lower_term, evil_twin->lower_term)) return false;
+ && !Obj_Equals(self->lower_term, twin->lower_term)) return false;
if ( self->upper_term
- && !Obj_Equals(self->upper_term, evil_twin->upper_term)) return false;
- if (self->include_lower != evil_twin->include_lower) return false;
- if (self->include_upper != evil_twin->include_upper) return false;
+ && !Obj_Equals(self->upper_term, twin->upper_term)) return false;
+ if (self->include_lower != twin->include_lower) return false;
+ if (self->include_upper != twin->include_upper) return false;
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Search/TermQuery.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Search/TermQuery.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Search/TermQuery.c (original)
+++ incubator/lucy/trunk/core/Lucy/Search/TermQuery.c Sat Apr 2 16:04:28 2011
@@ -84,12 +84,12 @@ TermQuery_get_term(TermQuery *self) { r
bool_t
TermQuery_equals(TermQuery *self, Obj *other)
{
- TermQuery *evil_twin = (TermQuery*)other;
- if (evil_twin == self) return true;
+ TermQuery *twin = (TermQuery*)other;
+ if (twin == self) return true;
if (!Obj_Is_A(other, TERMQUERY)) return false;
- if (self->boost != evil_twin->boost) return false;
- if (!CB_Equals(self->field, (Obj*)evil_twin->field)) return false;
- if (!Obj_Equals(self->term, evil_twin->term)) return false;
+ if (self->boost != twin->boost) return false;
+ if (!CB_Equals(self->field, (Obj*)twin->field)) return false;
+ if (!Obj_Equals(self->term, twin->term)) return false;
return true;
}
@@ -161,13 +161,13 @@ TermCompiler_init(TermCompiler *self, Qu
bool_t
TermCompiler_equals(TermCompiler *self, Obj *other)
{
- TermCompiler *evil_twin = (TermCompiler*)other;
+ TermCompiler *twin = (TermCompiler*)other;
if (!Compiler_equals((Compiler*)self, other)) return false;
if (!Obj_Is_A(other, TERMCOMPILER)) return false;
- if (self->idf != evil_twin->idf) return false;
- if (self->raw_weight != evil_twin->raw_weight) return false;
- if (self->query_norm_factor != evil_twin->query_norm_factor) return false;
- if (self->normalized_weight != evil_twin->normalized_weight) return false;
+ if (self->idf != twin->idf) return false;
+ if (self->raw_weight != twin->raw_weight) return false;
+ if (self->query_norm_factor != twin->query_norm_factor) return false;
+ if (self->normalized_weight != twin->normalized_weight) return false;
return true;
}
Modified: incubator/lucy/trunk/core/Lucy/Store/InStream.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Store/InStream.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Store/InStream.c (original)
+++ incubator/lucy/trunk/core/Lucy/Store/InStream.c Sat Apr 2 16:04:28 2011
@@ -134,23 +134,23 @@ InStream_reopen(InStream *self, const Ch
offset, len, FH_Length(self->file_handle));
}
- InStream *evil_twin = (InStream*)VTable_Make_Obj(self->vtable);
- InStream_do_open(evil_twin, (Obj*)self->file_handle);
- if (filename != NULL) { CB_Mimic(evil_twin->filename, (Obj*)filename); }
- evil_twin->offset = offset;
- evil_twin->len = len;
- InStream_Seek(evil_twin, 0);
+ InStream *twin = (InStream*)VTable_Make_Obj(self->vtable);
+ InStream_do_open(twin, (Obj*)self->file_handle);
+ if (filename != NULL) { CB_Mimic(twin->filename, (Obj*)filename); }
+ twin->offset = offset;
+ twin->len = len;
+ InStream_Seek(twin, 0);
- return evil_twin;
+ return twin;
}
InStream*
InStream_clone(InStream *self)
{
- InStream *evil_twin = (InStream*)VTable_Make_Obj(self->vtable);
- InStream_do_open(evil_twin, (Obj*)self->file_handle);
- InStream_Seek(evil_twin, SI_tell(self));
- return evil_twin;
+ InStream *twin = (InStream*)VTable_Make_Obj(self->vtable);
+ InStream_do_open(twin, (Obj*)self->file_handle);
+ InStream_Seek(twin, SI_tell(self));
+ return twin;
}
CharBuf*
Modified: incubator/lucy/trunk/core/Lucy/Test/Object/TestBitVector.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Test/Object/TestBitVector.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Test/Object/TestBitVector.c (original)
+++ incubator/lucy/trunk/core/Lucy/Test/Object/TestBitVector.c Sat Apr 2 16:04:28 2011
@@ -373,22 +373,22 @@ test_Clone(TestBatch *batch)
{
int i;
BitVector *self = BitVec_new(30);
- BitVector *evil_twin;
+ BitVector *twin;
BitVec_Set(self, 2);
BitVec_Set(self, 3);
BitVec_Set(self, 10);
BitVec_Set(self, 20);
- evil_twin = BitVec_Clone(self);
+ twin = BitVec_Clone(self);
for (i = 0; i < 50; i++) {
- if (BitVec_Get(self, i) != BitVec_Get(evil_twin, i)) { break; }
+ if (BitVec_Get(self, i) != BitVec_Get(twin, i)) { break; }
}
TEST_INT_EQ(batch, i, 50, "Clone");
- TEST_INT_EQ(batch, BitVec_Count(evil_twin), 4, "clone Count");
+ TEST_INT_EQ(batch, BitVec_Count(twin), 4, "clone Count");
DECREF(self);
- DECREF(evil_twin);
+ DECREF(twin);
}
static int
Modified: incubator/lucy/trunk/core/Lucy/Test/Object/TestByteBuf.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Test/Object/TestByteBuf.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Test/Object/TestByteBuf.c (original)
+++ incubator/lucy/trunk/core/Lucy/Test/Object/TestByteBuf.c Sat Apr 2 16:04:28 2011
@@ -68,10 +68,10 @@ static void
test_Clone(TestBatch *batch)
{
ByteBuf *bb = BB_new_bytes("foo", 3);
- ByteBuf *evil_twin = BB_Clone(bb);
- TEST_TRUE(batch, BB_Equals(bb, (Obj*)evil_twin), "Clone");
+ ByteBuf *twin = BB_Clone(bb);
+ TEST_TRUE(batch, BB_Equals(bb, (Obj*)twin), "Clone");
DECREF(bb);
- DECREF(evil_twin);
+ DECREF(twin);
}
static void
Modified: incubator/lucy/trunk/core/Lucy/Test/Object/TestVArray.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Test/Object/TestVArray.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Test/Object/TestVArray.c (original)
+++ incubator/lucy/trunk/core/Lucy/Test/Object/TestVArray.c Sat Apr 2 16:04:28 2011
@@ -227,25 +227,25 @@ static void
test_Clone_and_Shallow_Copy(TestBatch *batch)
{
VArray *array = VA_new(0);
- VArray *evil_twin;
+ VArray *twin;
uint32_t i;
for (i = 0; i < 10; i++) {
VA_Push(array, (Obj*)CB_newf("%u32", i));
}
- evil_twin = VA_Shallow_Copy(array);
- TEST_TRUE(batch, VA_Equals(array, (Obj*)evil_twin), "Shallow_Copy");
- TEST_TRUE(batch, VA_Fetch(array, 1) == VA_Fetch(evil_twin, 1),
+ twin = VA_Shallow_Copy(array);
+ TEST_TRUE(batch, VA_Equals(array, (Obj*)twin), "Shallow_Copy");
+ TEST_TRUE(batch, VA_Fetch(array, 1) == VA_Fetch(twin, 1),
"Shallow_Copy doesn't clone elements");
- DECREF(evil_twin);
+ DECREF(twin);
- evil_twin = VA_Clone(array);
- TEST_TRUE(batch, VA_Equals(array, (Obj*)evil_twin), "Clone");
- TEST_TRUE(batch, VA_Fetch(array, 1) != VA_Fetch(evil_twin, 1),
+ twin = VA_Clone(array);
+ TEST_TRUE(batch, VA_Equals(array, (Obj*)twin), "Clone");
+ TEST_TRUE(batch, VA_Fetch(array, 1) != VA_Fetch(twin, 1),
"Clone performs deep clone");
DECREF(array);
- DECREF(evil_twin);
+ DECREF(twin);
}
static void
Modified: incubator/lucy/trunk/core/Lucy/Test/Search/TestPhraseQuery.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Test/Search/TestPhraseQuery.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Test/Search/TestPhraseQuery.c (original)
+++ incubator/lucy/trunk/core/Lucy/Test/Search/TestPhraseQuery.c Sat Apr 2 16:04:28 2011
@@ -29,12 +29,12 @@ test_Dump_And_Load(TestBatch *batch)
PhraseQuery *query
= TestUtils_make_phrase_query("content", "a", "b", "c", NULL);
Obj *dump = (Obj*)PhraseQuery_Dump(query);
- PhraseQuery *evil_twin = (PhraseQuery*)Obj_Load(dump, dump);
- TEST_TRUE(batch, PhraseQuery_Equals(query, (Obj*)evil_twin),
+ PhraseQuery *twin = (PhraseQuery*)Obj_Load(dump, dump);
+ TEST_TRUE(batch, PhraseQuery_Equals(query, (Obj*)twin),
"Dump => Load round trip");
DECREF(query);
DECREF(dump);
- DECREF(evil_twin);
+ DECREF(twin);
}
void
Modified: incubator/lucy/trunk/core/LucyX/Search/ProximityQuery.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/LucyX/Search/ProximityQuery.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/core/LucyX/Search/ProximityQuery.c (original)
+++ incubator/lucy/trunk/core/LucyX/Search/ProximityQuery.c Sat Apr 2 16:04:28 2011
@@ -105,16 +105,16 @@ ProximityQuery_deserialize(ProximityQuer
bool_t
ProximityQuery_equals(ProximityQuery *self, Obj *other)
{
- ProximityQuery *evil_twin = (ProximityQuery*)other;
- if (evil_twin == self) return true;
+ ProximityQuery *twin = (ProximityQuery*)other;
+ if (twin == self) return true;
if (!Obj_Is_A(other, PROXIMITYQUERY)) return false;
- if (self->boost != evil_twin->boost) return false;
- if (self->field && !evil_twin->field) return false;
- if (!self->field && evil_twin->field) return false;
- if (self->field && !CB_Equals(self->field, (Obj*)evil_twin->field))
+ if (self->boost != twin->boost) return false;
+ if (self->field && !twin->field) return false;
+ if (!self->field && twin->field) return false;
+ if (self->field && !CB_Equals(self->field, (Obj*)twin->field))
return false;
- if (!VA_Equals(evil_twin->terms, (Obj*)self->terms)) return false;
- if (self->within != evil_twin->within) return false;
+ if (!VA_Equals(twin->terms, (Obj*)self->terms)) return false;
+ if (self->within != twin->within) return false;
return true;
}
@@ -238,14 +238,14 @@ ProximityCompiler_deserialize(ProximityC
bool_t
ProximityCompiler_equals(ProximityCompiler *self, Obj *other)
{
- ProximityCompiler *evil_twin = (ProximityCompiler*)other;
+ ProximityCompiler *twin = (ProximityCompiler*)other;
if (!Obj_Is_A(other, PROXIMITYCOMPILER)) return false;
if (!Compiler_equals((Compiler*)self, other)) return false;
- if (self->idf != evil_twin->idf) return false;
- if (self->raw_weight != evil_twin->raw_weight) return false;
- if (self->query_norm_factor != evil_twin->query_norm_factor) return false;
- if (self->normalized_weight != evil_twin->normalized_weight) return false;
- if (self->within != evil_twin->within) return false;
+ if (self->idf != twin->idf) return false;
+ if (self->raw_weight != twin->raw_weight) return false;
+ if (self->query_norm_factor != twin->query_norm_factor) return false;
+ if (self->normalized_weight != twin->normalized_weight) return false;
+ if (self->within != twin->within) return false;
return true;
}
Modified: incubator/lucy/trunk/perl/t/504-similarity.t
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/t/504-similarity.t?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/t/504-similarity.t (original)
+++ incubator/lucy/trunk/perl/t/504-similarity.t Sat Apr 2 16:04:28 2011
@@ -44,9 +44,9 @@ use Lucy::Test;
use bytes;
no bytes;
-my $sim = Lucy::Index::Similarity->new;
-my $evil_twin = $sim->load( $sim->dump );
-ok( $sim->equals($evil_twin), "Dump/Load" );
+my $sim = Lucy::Index::Similarity->new;
+my $twin = $sim->load( $sim->dump );
+ok( $sim->equals($twin), "Dump/Load" );
cmp_ok( $sim->tf(10) - $sim->tf(9), '<', 1, "TF is damped" );
Modified: incubator/lucy/trunk/perl/t/binding/016-varray.t
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/t/binding/016-varray.t?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/t/binding/016-varray.t (original)
+++ incubator/lucy/trunk/perl/t/binding/016-varray.t Sat Apr 2 16:04:28 2011
@@ -20,7 +20,7 @@ use Test::More tests => 3;
use Storable qw( nfreeze thaw );
use Lucy::Test;
-my ( $varray, $evil_twin );
+my ( $varray, $twin );
$varray = Lucy::Object::VArray->new( capacity => 5 );
$varray->push( Lucy::Object::CharBuf->new($_) ) for 1 .. 5;
@@ -40,6 +40,6 @@ my $deserialized = $varray->deserialize(
is_deeply( $varray->to_perl, $deserialized->to_perl,
"serialize/deserialize" );
-$evil_twin = $varray->_clone;
-is_deeply( $evil_twin->to_perl, $varray->to_perl, "clone" );
+$twin = $varray->_clone;
+is_deeply( $twin->to_perl, $varray->to_perl, "clone" );
Modified: incubator/lucy/trunk/perl/t/binding/019-obj.t
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/t/binding/019-obj.t?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/t/binding/019-obj.t (original)
+++ incubator/lucy/trunk/perl/t/binding/019-obj.t Sat Apr 2 16:04:28 2011
@@ -74,7 +74,7 @@ isa_ok( $object, "Lucy::Object::Obj",
"Clownfish objects can be subclassed outside the Lucy hierarchy" );
# TODO: Port this test to C.
-eval { my $evil_twin = $object->clone };
+eval { my $twin = $object->clone };
like( $@, qr/abstract/i, "clone throws an abstract method exception" );
ok( $object->is_a("Lucy::Object::Obj"), "custom is_a correct" );
Modified: incubator/lucy/trunk/perl/xs/Lucy/Document/Doc.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/xs/Lucy/Document/Doc.c?rev=1088055&r1=1088054&r2=1088055&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/xs/Lucy/Document/Doc.c (original)
+++ incubator/lucy/trunk/perl/xs/Lucy/Document/Doc.c Sat Apr 2 16:04:28 2011
@@ -162,19 +162,19 @@ lucy_Doc_load(lucy_Doc *self, lucy_Obj *
chy_bool_t
lucy_Doc_equals(lucy_Doc *self, lucy_Obj *other)
{
- lucy_Doc *evil_twin = (lucy_Doc*)other;
+ lucy_Doc *twin = (lucy_Doc*)other;
HV *my_fields;
HV *other_fields;
I32 num_fields;
- if (evil_twin == self) { return true; }
+ if (twin == self) { return true; }
if (!Lucy_Obj_Is_A(other, LUCY_DOC)) { return false; }
- if (!self->doc_id == evil_twin->doc_id) { return false; }
- if (!!self->fields ^ !!evil_twin->fields) { return false; }
+ if (!self->doc_id == twin->doc_id) { return false; }
+ if (!!self->fields ^ !!twin->fields) { return false; }
// Verify fields. Don't allow any deep data structures.
my_fields = (HV*)self->fields;
- other_fields = (HV*)evil_twin->fields;
+ other_fields = (HV*)twin->fields;
if (HvKEYS(my_fields) != HvKEYS(other_fields)) { return false; }
num_fields = hv_iterinit(my_fields);
while(num_fields--) {