summaryrefslogtreecommitdiff
path: root/src/xline.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2005-11-30 05:45:03 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2005-11-30 05:45:03 +0000
commit7aded111763af65e78841e6604b21c590cbcd12b (patch)
tree238f18b7e602b7d42aea1f5f2d62f7a83a107151 /src/xline.cpp
parent5a1a0994f56f09ff1df37a18025502ecf2a122ca (diff)
Split the expiry loop into sections, to hopefully decrease time taken to expire with large amounts of *lines.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2023 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/xline.cpp')
-rw-r--r--src/xline.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/xline.cpp b/src/xline.cpp
index 0f329602c..7a6db9a61 100644
--- a/src/xline.cpp
+++ b/src/xline.cpp
@@ -465,6 +465,12 @@ void expire_lines()
// because we mess up an iterator when we remove from the vector, we must bail from
// the loop early if we delete an item, therefore this outer while loop is required.
+ //
+ // 30/11/2005-- I can imagine that if we get a large number of *lines, this would perform dog slow.
+ // While we try and think of a better solution, for now I've simply split the loops up, instead of
+ // one huge while () -- this means if we remove a g-line, we only need to re-check glines, not z/g/.
+ // lines too, hopefully a little faster, even if it looks a little messier ;) --w00t
+
while (go_again)
{
go_again = false;
@@ -479,6 +485,13 @@ void expire_lines()
break;
}
}
+ }
+
+ go_again = true;
+
+ while (go_again)
+ {
+ go_again = false;
for (std::vector<ELine>::iterator i = elines.begin(); i != elines.end(); i++)
{
@@ -490,6 +503,13 @@ void expire_lines()
break;
}
}
+ }
+
+ go_again = true;
+
+ while (go_again)
+ {
+ go_again = false;
for (std::vector<GLine>::iterator i = glines.begin(); i != glines.end(); i++)
{
@@ -501,6 +521,13 @@ void expire_lines()
break;
}
}
+ }
+
+ go_again = true;
+
+ while (go_again)
+ {
+ go_again = false;
for (std::vector<ZLine>::iterator i = zlines.begin(); i != zlines.end(); i++)
{
@@ -512,6 +539,14 @@ void expire_lines()
break;
}
}
+ }
+
+ go_again = true;
+
+
+ while (go_again)
+ {
+ go_again = false;
for (std::vector<QLine>::iterator i = qlines.begin(); i != qlines.end(); i++)
{