diff liboctave/array/idx-vector.h @ 31204:a81fad5c9fef

idx_vector: Fix wrong length calculation (bug #62968). * liboctave/array/idx-vector.cc: Fix wrong calculation for m_len in (start, limit, step) constructor to account for incomplete intervals. * liboctave/array/idx-vector.h: Add comment to (start, limit, step) constructor.
author Maged Rifaat <magedrifaat@gmail.com>
date Sat, 27 Aug 2022 13:41:44 +0200
parents 796f54d4ddbf
children e88a07dec498
line wrap: on
line diff
--- a/liboctave/array/idx-vector.h	Fri Aug 26 22:30:43 2022 +0200
+++ b/liboctave/array/idx-vector.h	Sat Aug 27 13:41:44 2022 +0200
@@ -171,7 +171,8 @@
                      octave_idx_type step, direct)
         : idx_base_rep (), m_start (start), m_len (len), m_step (step) { }
 
-      // Zero-based constructor.
+      // Zero-based constructor for index range starting at `start` (inclusive)
+      // and ending at `limit` (exclusive) in steps of `step`.
       idx_range_rep (octave_idx_type start, octave_idx_type limit,
                      octave_idx_type step);