diff --git a/preprocessor/macro/MacroValue.cc b/preprocessor/macro/MacroValue.cc index d2118075606d9fd2d68abb4412e4705035ccb4cd..98833caba4bc8f3d0455e103ad6a944fda5d4fe6 100644 --- a/preprocessor/macro/MacroValue.cc +++ b/preprocessor/macro/MacroValue.cc @@ -325,12 +325,6 @@ IntMV::new_range(MacroDriver &driver, const MacroValue *mv1, const MacroValue *m int v2 = mv2i->value; vector<int> result; - if (v2 < v1) - { - int x = v2; - v2 = v1; - v1 = x; - } for (; v1 <= v2; v1++) result.push_back(v1); return new ArrayMV<int>(driver, result); diff --git a/preprocessor/macro/MacroValue.hh b/preprocessor/macro/MacroValue.hh index 52b566f4c4f7f3cd0fc40c86327268a141c0a49e..e379a602628c104757a544fd2edae9f379a33b7d 100644 --- a/preprocessor/macro/MacroValue.hh +++ b/preprocessor/macro/MacroValue.hh @@ -153,7 +153,7 @@ public: //! Creates a integer range /*! Arguments must be of type IntMV. Returns an integer array containing all integers between mv1 and mv2. - If mv2 < mv1, constructs the range in decreasing order. + If mv2 < mv1, returns an empty range (for consistency with MATLAB). */ static const MacroValue *new_range(MacroDriver &driver, const MacroValue *mv1, const MacroValue *mv2) throw (TypeError); };