Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 04db37c

Browse files
runrevmarkpeter-b
authored andcommitted
[[ VarAccess ]] Remove 'rootmatches()' and uses from MCVarref
This patch removes the 'rootmatches()' method from MCVarref along with its uses in the arithmetic commands. The latter used it to compute overlap between base and value expressions but this information is no longer needed.
1 parent 2f3c3c0 commit 04db37c

File tree

5 files changed

+0
-62
lines changed

5 files changed

+0
-62
lines changed

engine/src/cmds.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -982,11 +982,6 @@ Parse_stat MCPut::parse(MCScriptPoint &sp)
982982
return PS_ERROR;
983983
}
984984

985-
MCVarref *t_src_ref, *t_dst_ref;
986-
t_src_ref = source -> getrootvarref();
987-
t_dst_ref = dest -> getrootvarref();
988-
overlap = t_src_ref != NULL && t_dst_ref != NULL && t_src_ref -> rootmatches(t_dst_ref);
989-
990985
return PS_NORMAL;
991986
}
992987

engine/src/cmds.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ class MCPut : public MCStatement
256256
// MW-2012-02-23: [[ UnicodePut ]] Indicates if the 'unicode' adjective
257257
// was present.
258258
bool is_unicode : 1;
259-
bool overlap : 1;
260259

261260
//cookie
262261
MCExpression *name;
@@ -272,7 +271,6 @@ class MCPut : public MCStatement
272271
// MW-2011-06-22: [[ SERVER ]] Make a distinction between 'put' and 'put .. into msg'
273272
prep = PT_UNDEFINED;
274273
dest = NULL;
275-
overlap = false;
276274
// cookie
277275
name = NULL;
278276
path = NULL;
@@ -1627,14 +1625,12 @@ class MCAdd : public MCStatement
16271625
MCExpression *source;
16281626
MCChunk *dest;
16291627
MCVarref *destvar;
1630-
bool overlap;
16311628
public:
16321629
MCAdd()
16331630
{
16341631
source = NULL;
16351632
dest = NULL;
16361633
destvar = NULL;
1637-
overlap = false;
16381634
}
16391635
virtual ~MCAdd();
16401636
virtual Parse_stat parse(MCScriptPoint &);
@@ -1647,14 +1643,12 @@ class MCDivide : public MCStatement
16471643
MCExpression *source;
16481644
MCChunk *dest;
16491645
MCVarref *destvar;
1650-
bool overlap;
16511646
public:
16521647
MCDivide()
16531648
{
16541649
source = NULL;
16551650
dest = NULL;
16561651
destvar = NULL;
1657-
overlap = false;
16581652
}
16591653
virtual ~MCDivide();
16601654
virtual Parse_stat parse(MCScriptPoint &);
@@ -1667,14 +1661,12 @@ class MCMultiply : public MCStatement
16671661
MCExpression *source;
16681662
MCChunk *dest;
16691663
MCVarref *destvar;
1670-
bool overlap;
16711664
public:
16721665
MCMultiply()
16731666
{
16741667
source = NULL;
16751668
dest = NULL;
16761669
destvar = NULL;
1677-
overlap = false;
16781670
}
16791671
virtual ~MCMultiply();
16801672
virtual Parse_stat parse(MCScriptPoint &);
@@ -1687,14 +1679,12 @@ class MCSubtract : public MCStatement
16871679
MCExpression *source;
16881680
MCChunk *dest;
16891681
MCVarref *destvar;
1690-
bool overlap;
16911682
public:
16921683
MCSubtract()
16931684
{
16941685
source = NULL;
16951686
dest = NULL;
16961687
destvar = NULL;
1697-
overlap = false;
16981688
}
16991689
virtual ~MCSubtract();
17001690
virtual Parse_stat parse(MCScriptPoint &);
@@ -1769,7 +1759,6 @@ class MCSetOp : public MCStatement
17691759
MCExpression *source;
17701760
protected:
17711761
bool intersect : 1;
1772-
bool overlap : 1;
17731762
// MERG-2013-08-26: [[ RecursiveArrayOp ]] Support nested arrays in union and intersect
17741763
bool recursive : 1;
17751764
public:

engine/src/cmdsm.cpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -37,28 +37,6 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
3737

3838
////////////////////////////////////////////////////////////////////////
3939

40-
//
41-
42-
inline bool MCMathOpCommandComputeOverlap(MCExpression *p_source, MCExpression *p_dest, MCVarref *p_destvar)
43-
{
44-
MCVarref *t_src_ref;
45-
t_src_ref = p_source -> getrootvarref();
46-
if (t_src_ref == NULL)
47-
return false;
48-
49-
if (p_destvar != NULL)
50-
return t_src_ref -> rootmatches(p_destvar);
51-
52-
MCVarref *t_dst_ref;
53-
t_dst_ref = p_dest -> getrootvarref();
54-
if (t_dst_ref == NULL)
55-
return false;
56-
57-
return t_src_ref -> rootmatches(t_dst_ref);
58-
}
59-
60-
//
61-
6240
MCAdd::~MCAdd()
6341
{
6442
delete source;
@@ -102,8 +80,6 @@ Parse_stat MCAdd::parse(MCScriptPoint &sp)
10280
if (dest != NULL && dest -> isvarchunk())
10381
destvar = dest -> getrootvarref();
10482

105-
overlap = MCMathOpCommandComputeOverlap(source, dest, destvar);
106-
10783
return PS_NORMAL;
10884
}
10985

@@ -265,8 +241,6 @@ Parse_stat MCDivide::parse(MCScriptPoint &sp)
265241
// MW-2013-08-01: [[ Bug 10925 ]] If the dest chunk is just a var, extract the varref.
266242
if (dest != NULL && dest -> isvarchunk())
267243
destvar = dest -> getrootvarref();
268-
269-
overlap = MCMathOpCommandComputeOverlap(source, dest, destvar);
270244

271245
return PS_NORMAL;
272246
}
@@ -433,8 +407,6 @@ Parse_stat MCMultiply::parse(MCScriptPoint &sp)
433407
// MW-2013-08-01: [[ Bug 10925 ]] If the dest chunk is just a var, extract the varref.
434408
if (dest != NULL && dest -> isvarchunk())
435409
destvar = dest -> getrootvarref();
436-
437-
overlap = MCMathOpCommandComputeOverlap(source, dest, destvar);
438410

439411
return PS_NORMAL;
440412
}
@@ -601,8 +573,6 @@ Parse_stat MCSubtract::parse(MCScriptPoint &sp)
601573
// MW-2013-08-01: [[ Bug 10925 ]] If the dest chunk is just a var, extract the varref.
602574
if (dest != NULL && dest -> isvarchunk())
603575
destvar = dest -> getrootvarref();
604-
605-
overlap = MCMathOpCommandComputeOverlap(source, dest, destvar);
606576

607577
return PS_NORMAL;
608578
}

engine/src/variable.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,17 +1330,6 @@ MCVarref *MCVarref::getrootvarref(void)
13301330
return this;
13311331
}
13321332

1333-
bool MCVarref::rootmatches(MCVarref *p_other) const
1334-
{
1335-
if (this == p_other)
1336-
return true;
1337-
1338-
if (p_other -> ref != NULL)
1339-
return ref == p_other -> ref;
1340-
1341-
return handler == p_other -> handler && index == p_other -> index && isparam == p_other -> isparam;
1342-
}
1343-
13441333
bool MCVarref::set(MCExecContext& ctxt, MCValueRef p_value, MCVariableSettingStyle p_setting)
13451334
{
13461335
if (dimensions == 0 && !isparam)

engine/src/variable.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -399,13 +399,8 @@ class MCVarref : public MCExpression
399399
virtual void compile_out(MCSyntaxFactoryRef);
400400
virtual void compile_inout(MCSyntaxFactoryRef);
401401

402-
//virtual MCVariable *getvar();
403402
virtual MCVarref *getrootvarref(void);
404403

405-
// This method returns true if p_other refers to the same root
406-
// variable as self.
407-
bool rootmatches(MCVarref *p_other) const;
408-
409404
Boolean getisscriptlocal() { return isscriptlocal; };
410405

411406
bool set(MCExecContext& ctxt, MCValueRef p_value, MCVariableSettingStyle p_setting = kMCVariableSetInto);

0 commit comments

Comments
 (0)