Ignore:
Timestamp:
10/01/21 23:40:49 (4 weeks ago)
Author:
Maciej Komosinski
Message:

Cosmetic/minor improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/vm/classes/collectionobj.h

    r929 r1158  
    1616public:
    1717        SList data;
    18         unsigned int readonly : 1, owndata : 1;
     18        unsigned int owndata : 1;
    1919        void clear();
    2020        ExtValue *get(int i) { return (ExtValue*)data.get(i); }
     
    2424        static Param par;
    2525        VectorObject(Pt3D& pt);
    26         VectorObject() :readonly(0), owndata(1) {}
     26        VectorObject() :owndata(1) {}
    2727        ~VectorObject() { clear(); }
    2828        static Param& getStaticParam() { return par; }
    2929#define STATRICKCLASS VectorObject
    30         PARAMPROCDEF(p_clear) { if (readonly) return; clear(); }
     30        PARAMPROCDEF(p_clear) { clear(); }
    3131        PARAMGETDEF(size) { arg1->setInt(data.size()); }
    3232        PARAMGETDEF(avg);
     
    3636        PARAMPROCDEF(p_get);
    3737        PARAMPROCDEF(p_find);
    38         PARAMPROCDEF(p_set) { if (!readonly) set_or_insert(arg1[1].getInt(), arg1[0], false); }
    39         PARAMPROCDEF(p_add) { if (readonly) return; /*ExtValue tmp; get_toString(&tmp); printf("%s += %s",(const char*)tmp.getString(),(const char*)arg1[0].getString());*/ data += new ExtValue(arg1[0]); /*get_toString(&tmp); printf(" -> %s\n",(const char*)tmp.getString());*/ arg2->setInt(data.size() - 1); }
    40         PARAMPROCDEF(p_insert) { if (!readonly) set_or_insert(arg1[1].getInt(), arg1[0], true); }
     38        PARAMPROCDEF(p_set) { set_or_insert(arg1[1].getInt(), arg1[0], false); }
     39        PARAMPROCDEF(p_add) { data += new ExtValue(arg1[0]); arg2->setInt(data.size() - 1); }
     40        PARAMPROCDEF(p_insert) { set_or_insert(arg1[1].getInt(), arg1[0], true); }
    4141        PARAMGETDEF(toString);
    4242        PARAMPROCDEF(p_sort);
Note: See TracChangeset for help on using the changeset viewer.