More optimizations!
Originally committed to SVN as r2370.
This commit is contained in:
parent
70e138bbf1
commit
cbc6260786
4 changed files with 6 additions and 6 deletions
|
@ -126,6 +126,7 @@
|
||||||
AdditionalIncludeDirectories="include/athenasub;src"
|
AdditionalIncludeDirectories="include/athenasub;src"
|
||||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_WINDOWS;ATHENA_EXPORTS"
|
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_WINDOWS;ATHENA_EXPORTS"
|
||||||
RuntimeLibrary="2"
|
RuntimeLibrary="2"
|
||||||
|
StructMemberAlignment="0"
|
||||||
EnableEnhancedInstructionSet="0"
|
EnableEnhancedInstructionSet="0"
|
||||||
UsePrecompiledHeader="2"
|
UsePrecompiledHeader="2"
|
||||||
PrecompiledHeaderThrough="prec.h"
|
PrecompiledHeaderThrough="prec.h"
|
||||||
|
|
|
@ -179,7 +179,7 @@ Action ActionModifyBatch::GetAntiAction(const IModel& model) const
|
||||||
// For each line...
|
// For each line...
|
||||||
for (size_t i=0;i<len;i++) {
|
for (size_t i=0;i<len;i++) {
|
||||||
// Get old entry
|
// Get old entry
|
||||||
Entry oldEntry = sect->GetEntry(selection->GetLine(i));
|
Entry& oldEntry = sect->GetEntryRef(selection->GetLine(i));
|
||||||
|
|
||||||
// Try to get a delta
|
// Try to get a delta
|
||||||
DeltaCoder deltaCoder = oldEntry->GetDeltaCoder();
|
DeltaCoder deltaCoder = oldEntry->GetDeltaCoder();
|
||||||
|
@ -213,7 +213,7 @@ Action ActionModifyBatch::GetAntiAction(const IModel& model) const
|
||||||
// For each line...
|
// For each line...
|
||||||
for (size_t i=0;i<len;i++) {
|
for (size_t i=0;i<len;i++) {
|
||||||
// Get old entry
|
// Get old entry
|
||||||
Entry oldEntry = sect->GetEntry(selection->GetLine(i));
|
Entry& oldEntry = sect->GetEntryRef(selection->GetLine(i));
|
||||||
|
|
||||||
// Try to get a delta
|
// Try to get a delta
|
||||||
DeltaCoder deltaCoder = oldEntry->GetDeltaCoder();
|
DeltaCoder deltaCoder = oldEntry->GetDeltaCoder();
|
||||||
|
|
|
@ -147,12 +147,11 @@ std::vector<Entry> CActionList::ModifyLines(Selection selection,const String sec
|
||||||
for (size_t i=0;i<len;i++) {
|
for (size_t i=0;i<len;i++) {
|
||||||
size_t rLen = selection->GetLinesInRange(i);
|
size_t rLen = selection->GetLinesInRange(i);
|
||||||
for (size_t j=0;j<rLen;j++) {
|
for (size_t j=0;j<rLen;j++) {
|
||||||
entries[n++] = sect->GetEntry(selection->GetLineInRange(j,i))->Clone();
|
entries[n++] = sect->GetEntryRef(selection->GetLineInRange(j,i))->Clone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate the action
|
// Generate the action
|
||||||
Action action = Action (new ActionModifyBatch(entries,std::vector<VoidPtr>(),selection,section,false));
|
AddAction(Action(new ActionModifyBatch(entries,std::vector<VoidPtr>(),selection,section,false)));
|
||||||
AddAction(action);
|
|
||||||
return entries;
|
return entries;
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,7 +94,7 @@ int main()
|
||||||
#ifdef WXDEBUG
|
#ifdef WXDEBUG
|
||||||
int n = 1;
|
int n = 1;
|
||||||
#else
|
#else
|
||||||
int n = 100;
|
int n = 1000;
|
||||||
#endif
|
#endif
|
||||||
cout << "Executing action " << n << " times... ";
|
cout << "Executing action " << n << " times... ";
|
||||||
timer.Start();
|
timer.Start();
|
||||||
|
|
Loading…
Reference in a new issue