From 351b285030ab96d94c2f4a2b7a01a64ae266a2a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sun, 10 Jun 2012 11:50:05 +0200 Subject: edoors_particle_split_dst: fix action replace optimisation --- src/lib/edoors_particle.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/edoors_particle.c b/src/lib/edoors_particle.c index 468cd5b..f1155be 100644 --- a/src/lib/edoors_particle.c +++ b/src/lib/edoors_particle.c @@ -136,9 +136,9 @@ EAPI void edoors_particle_split_dst(Edoors_Particle *particle) tmp = sep+sizeof(char); /* action defined */ if(particle->cur_action) { - if(strcmp(particle->cur_action,tmp)!=0) { - eina_stringshare_del(particle->cur_action); - particle->cur_action = eina_stringshare_add(tmp); + n = strlen(tmp); + if( eina_stringshare_strlen(particle->cur_action)!=n || strncmp(particle->cur_action,tmp,n)!=0) { + eina_stringshare_replace(&particle->cur_action,tmp); } /* else : keep the same stringshare */ } else { -- cgit v1.1-2-g2b99