summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-10-07 10:32:52 +0300
committerTor Lillqvist <tml@collabora.com>2014-10-07 10:42:20 +0300
commitd1fbbb04f9c12614a7b64e4c1eb92dc6a5ea3fc7 (patch)
tree7c560dd3d8de70384da177983f124806d01ab8d7 /comphelper
parent1b226b02471f2fab5e5e6f79b6593636274d2320 (diff)
I shouldn't be shy, just assert()
Stephan dislikes "defensive programming" and I trust him. Change-Id: Ic4864de98a5155129179eb89873f3ffdc8921614
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/misc/random.cxx4
1 files changed, 1 insertions, 3 deletions
diff --git a/comphelper/source/misc/random.cxx b/comphelper/source/misc/random.cxx
index 9071765585fd..bcdd8e6c7198 100644
--- a/comphelper/source/misc/random.cxx
+++ b/comphelper/source/misc/random.cxx
@@ -80,9 +80,7 @@ size_t uniform_int_distribution(size_t a, size_t b)
// uniform size_t [a,b) distribution
double uniform_real_distribution(double a, double b)
{
- // Probably too rude to just assert(a < b), so instead...
- if (a >= b)
- return a;
+ assert(a < b);
boost::random::uniform_real_distribution<double> dist(a, b);
return dist(theRandomNumberGenerator::get().global_rng);
}