]> www.ginac.de Git - ginac.git/blobdiff - ginac/matrix.cpp
Fix unarchiving empty containers.
[ginac.git] / ginac / matrix.cpp
index fb6750602caf1e36a34bc93eace613b24fea8323..a1be78cf2e8da4869128c08562cfdc56c1a48a8b 100644 (file)
@@ -140,13 +140,11 @@ void matrix::read_archive(const archive_node &n, lst &sym_lst)
        m.reserve(row * col);
        // XXX: default ctor inserts a zero element, we need to erase it here.
        m.pop_back();
-       auto first = n.find_first("m");
-       auto last = n.find_last("m");
-       ++last;
-       for (auto i=first; i != last; ++i) {
+       auto range = n.find_property_range("m", "m");
+       for (auto i=range.begin; i != range.end; ++i) {
                ex e;
                n.find_ex_by_loc(i, e, sym_lst);
-               m.push_back(e);
+               m.emplace_back(e);
        }
 }
 GINAC_BIND_UNARCHIVER(matrix);