summaryrefslogtreecommitdiff
path: root/indra/llmath/llmath.h
diff options
context:
space:
mode:
authorNyx (Neal Orman) <nyx@lindenlab.com>2011-06-06 11:42:04 -0400
committerNyx (Neal Orman) <nyx@lindenlab.com>2011-06-06 11:42:04 -0400
commit85b316e5df41444eafe77964f1a4758ccfd40784 (patch)
tree990d88b643a20877d49b8d56f84c38b83eb654c4 /indra/llmath/llmath.h
parent6a521b0578d430246c5ae5492a6dc9bc9060c2ff (diff)
BUILDFIX fixing crash on performance analysis when there is no variation
when fasttimers are amazingly consistent, we remove all data as outliers instead of removing nothing. Probably something else going on here, but this should fix the crash so we can analyze better.
Diffstat (limited to 'indra/llmath/llmath.h')
-rw-r--r--indra/llmath/llmath.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h
index eea7c977fb..9297bcbac2 100644
--- a/indra/llmath/llmath.h
+++ b/indra/llmath/llmath.h
@@ -510,6 +510,13 @@ inline void ll_remove_outliers(std::vector<VEC_TYPE>& data, F32 k)
VEC_TYPE Q1 = data[data.size()/4];
VEC_TYPE Q3 = data[data.size()-data.size()/4-1];
+ if ((F32)(Q3-Q1) < 1.f)
+ {
+ // not enough variation to detect outliers
+ return;
+ }
+
+
VEC_TYPE min = (VEC_TYPE) ((F32) Q1-k * (F32) (Q3-Q1));
VEC_TYPE max = (VEC_TYPE) ((F32) Q3+k * (F32) (Q3-Q1));