diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-08-21 21:27:44 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-08-21 21:27:44 +0200 |
commit | 9abc010c930999eed67253f5b83f7c226b1a17f6 (patch) | |
tree | 7a60ec4acef9fd7d68dbe97429c6c6d1a5870df8 /src/pulsecore/protocol-simple.c | |
parent | 5317e35543ab208a416cc662e2a6a88899a96704 (diff) |
object: speed up type verification by not relying on strcmp()
Instead of using string contents for type identification use the address
of a constant string array. This should speed up type verifications a
little sind we only need to compare one machine word instead of a full
string. Also, this saves a few strings.
To make clear that types must be compared via address and not string
contents 'type_name' is now called 'type_id'.
This also simplifies the macros for declaring and defining public and
private subclasses.
Diffstat (limited to 'src/pulsecore/protocol-simple.c')
-rw-r--r-- | src/pulsecore/protocol-simple.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/pulsecore/protocol-simple.c b/src/pulsecore/protocol-simple.c index 776d74b63..95ec6ac8e 100644 --- a/src/pulsecore/protocol-simple.c +++ b/src/pulsecore/protocol-simple.c @@ -69,9 +69,8 @@ typedef struct connection { } playback; } connection; -PA_DECLARE_CLASS(connection); +PA_DEFINE_PRIVATE_CLASS(connection, pa_msgobject); #define CONNECTION(o) (connection_cast(o)) -static PA_DEFINE_CHECK_TYPE(connection, pa_msgobject); struct pa_simple_protocol { PA_REFCNT_DECLARE; |