# HG changeset patch # User jwe # Date 769899734 0 # Node ID ec2a6ad30162dfc7f81f8202161c47f1bbc04a72 # Parent 49eddf39e77d4e109d014c58b602527103170fe3 [project @ 1994-05-25 21:00:20 by jwe] diff --git a/liboctave/idx-vector.cc b/liboctave/idx-vector.cc --- a/liboctave/idx-vector.cc +++ b/liboctave/idx-vector.cc @@ -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) { diff --git a/liboctave/idx-vector.h b/liboctave/idx-vector.h --- a/liboctave/idx-vector.h +++ b/liboctave/idx-vector.h @@ -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);