summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-04-25 13:42:49 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-04-25 13:42:49 +0000
commita52bb6e05d90c068396b45a96b28b5b10c3242f7 (patch)
tree0c225842ed1407789f0a2e35ba6eff38047ca536
parentf648a45e89b40f972f1016da1cc87ff780faaba9 (diff)
downloadhercules-a52bb6e05d90c068396b45a96b28b5b10c3242f7.tar.gz
hercules-a52bb6e05d90c068396b45a96b28b5b10c3242f7.tar.bz2
hercules-a52bb6e05d90c068396b45a96b28b5b10c3242f7.tar.xz
hercules-a52bb6e05d90c068396b45a96b28b5b10c3242f7.zip
Minor performance improvement on script function is_function -- replaced strdb_get with strdb_exists since we don't use the data at all.
Modified get_revision to return the revision number rather than it's string, when revision is not known by the server it now returns -1. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15969 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--src/map/script.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 14ee625f7..9fe8cd2e0 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -15843,7 +15843,7 @@ BUILDIN_FUNC(getargcount) {
BUILDIN_FUNC(is_function) {
const char* str = script_getstr(st,2);
- if( ((struct script_code*)strdb_get(userfunc_db, str)) != NULL )
+ if( strdb_exists(userfunc_db, str) )
script_pushint(st,1);
else
script_pushint(st,0);
@@ -15857,9 +15857,9 @@ BUILDIN_FUNC(get_revision) {
const char * revision;
if ( (revision = get_svn_revision()) != 0 )
- script_pushstrcopy(st,revision);
+ script_pushint(st,atoi(revision));
else
- script_pushconststr(st,"Unknown");
+ script_pushint(st,-1);//unknown
return 0;
}