summaryrefslogtreecommitdiff
path: root/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-07-01 13:26:39 +0300
committerDmitry Stogov <dmitry@zend.com>2015-07-01 13:26:39 +0300
commitf7b6de5b5eea4554a1eb3e7bfc64877567693985 (patch)
tree0f271798439b3c8c1982f52b5b73073849c7433c /ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
parent53403fe56d7c80eff75a3bd1bfd014aa33ac457b (diff)
downloadphp-git-f7b6de5b5eea4554a1eb3e7bfc64877567693985.tar.gz
Cleanup (avoid string reallocations)
Diffstat (limited to 'ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp')
-rw-r--r--ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
index 1988e7477d..8ab8194b17 100644
--- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
+++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
@@ -114,20 +114,18 @@ U_CFUNC PHP_FUNCTION(rbbi_get_rules)
BREAKITER_METHOD_FETCH_OBJECT;
- char *str;
- size_t str_len;
+ zend_string *u8str;
const UnicodeString rules = fetch_rbbi(bio)->getRules();
- if (intl_charFromString(rules, &str, &str_len, BREAKITER_ERROR_CODE_P(bio)) == FAILURE)
+ u8str = intl_charFromString(rules, BREAKITER_ERROR_CODE_P(bio));
+ if (!u8str)
{
intl_errors_set(BREAKITER_ERROR_P(bio), BREAKITER_ERROR_CODE(bio),
"rbbi_hash_code: Error converting result to UTF-8 string",
0);
RETURN_FALSE;
}
- RETVAL_STRINGL(str, str_len);
- //???
- efree(str);
+ RETVAL_STR(u8str);
}
U_CFUNC PHP_FUNCTION(rbbi_get_rule_status)