diff options
| author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> | 2019-01-23 03:36:36 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <marcjeanmougin@free.fr> | 2019-01-24 17:08:27 +0000 |
| commit | 9643b2fc2ee8fe82f689e3bfbdc3329a1421ec3d (patch) | |
| tree | 6fa48fa6c9721b921fd397944105d5072bebb6fb /src/debug/event.h | |
| parent | Remove unused svg-profile.h header file. (diff) | |
| download | inkscape-9643b2fc2ee8fe82f689e3bfbdc3329a1421ec3d.tar.gz inkscape-9643b2fc2ee8fe82f689e3bfbdc3329a1421ec3d.zip | |
Event: Make name and property name char const*.
Diffstat (limited to 'src/debug/event.h')
| -rw-r--r-- | src/debug/event.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/debug/event.h b/src/debug/event.h index e9fa5ae2e..de5cddd07 100644 --- a/src/debug/event.h +++ b/src/debug/event.h @@ -41,23 +41,22 @@ public: struct PropertyPair { public: PropertyPair() = default; - PropertyPair(Util::ptr_shared n, Util::ptr_shared v) - : name(n), value(v) {} PropertyPair(char const *n, Util::ptr_shared v) - : name(Util::share_string(n)), value(v) {} - PropertyPair(Util::ptr_shared n, char const *v) - : name(n), value(Util::share_string(v)) {} + : name(n), value(v) {} PropertyPair(char const *n, char const *v) - : name(Util::share_string(n)), + : name(n), value(Util::share_string(v)) {} - Util::ptr_shared name; + char const *name; Util::ptr_shared value; }; static Category category() { return OTHER; } - virtual Util::ptr_shared name() const=0; + // To reduce allocations, we assume the name here is always allocated statically and will never + // need to be deallocated. It would be nice to be able to assert that during the creation of + // the Event though. + virtual char const *name() const=0; virtual unsigned propertyCount() const=0; virtual PropertyPair property(unsigned property) const=0; |
