changeset 434:ec2a6ad30162

[project @ 1994-05-25 21:00:20 by jwe]
author jwe
date Wed, 25 May 1994 21:02:14 +0000
parents 49eddf39e77d
children 5e778965b6ea
files liboctave/idx-vector.cc liboctave/idx-vector.h
diffstat 2 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/liboctave/idx-vector.cc	Wed May 25 19:17:10 1994 +0000
+++ b/liboctave/idx-vector.cc	Wed May 25 21:02:14 1994 +0000
@@ -313,6 +313,15 @@
     }
 }
 
+void
+idx_vector::shorten (int n)
+{
+  if (n > 0 && n <= len)
+    len = n;
+  else
+    panic_impossible ();
+}
+
 ostream&
 operator << (ostream& os, const idx_vector& a)
 {
--- a/liboctave/idx-vector.h	Wed May 25 19:17:10 1994 +0000
+++ b/liboctave/idx-vector.h	Wed May 25 21:02:14 1994 +0000
@@ -64,6 +64,8 @@
   void sort (void);
   void sort_uniq (void);
 
+  void shorten (int n); // Unsafe.  Avoid at all cost.
+
 // i/o
 
   friend ostream& operator << (ostream& os, const idx_vector& a);