summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRay <[email protected]>2023-11-02 18:11:13 +0100
committerRay <[email protected]>2023-11-02 18:11:13 +0100
commit01bbd425196631ea16e3c8fd4666f801fe8e4692 (patch)
tree98c8add359916bbb340b4468424324b224d78e29
parentfe34fc7c6b7e3731ce7f68b379f9847eaaaf2a8f (diff)
downloadraylib-01bbd425196631ea16e3c8fd4666f801fe8e4692.tar.gz
raylib-01bbd425196631ea16e3c8fd4666f801fe8e4692.zip
Update rprand.h
-rw-r--r--src/external/rprand.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/external/rprand.h b/src/external/rprand.h
index a9b3a6ea..b8dc4a27 100644
--- a/src/external/rprand.h
+++ b/src/external/rprand.h
@@ -196,15 +196,14 @@ unsigned int *rprand_load_sequence(unsigned int count, int min, int max)
sequence = (unsigned int *)RPRAND_CALLOC(count, sizeof(unsigned int));
uint32_t value = 0;
- int value_count = 0;
bool value_is_dup = false;
- for (int i = 0; value_count < count; i++)
+ for (int i = 0; i < count;)
{
value = rprand_xoshiro()%(max - min) + min;
value_is_dup = false;
- for (int j = 0; j < value_count; j++)
+ for (int j = 0; j < i; j++)
{
if (sequence[j] == value)
{
@@ -215,8 +214,8 @@ unsigned int *rprand_load_sequence(unsigned int count, int min, int max)
if (!value_is_dup)
{
- sequence[value_count] = value;
- value_count++;
+ sequence[i] = value;
+ i++;
}
}