aboutsummaryrefslogtreecommitdiff
path: root/jim-eventloop.c
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2013-08-02 15:07:23 +1000
committerSteve Bennett <steveb@workware.net.au>2013-08-02 15:23:56 +1000
commit583ed76d426a42a3e9863933aaabbc0912f60bd7 (patch)
tree849a5e3ca148e2132864121d04d7e941b7671733 /jim-eventloop.c
parent07c5eecc55b7bd3deadaa6d6291323316a5447d6 (diff)
downloadjimtcl-583ed76d426a42a3e9863933aaabbc0912f60bd7.zip
jimtcl-583ed76d426a42a3e9863933aaabbc0912f60bd7.tar.gz
jimtcl-583ed76d426a42a3e9863933aaabbc0912f60bd7.tar.bz2
Minor code cleanups
Prefer Jim_String() and Jim_Length() over Jim_GetString() where it makes sense. Use Jim_ListGetIndex() where success is guaranteed. Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim-eventloop.c')
-rw-r--r--jim-eventloop.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/jim-eventloop.c b/jim-eventloop.c
index 5681b00..6744330 100644
--- a/jim-eventloop.c
+++ b/jim-eventloop.c
@@ -242,8 +242,7 @@ jim_wide Jim_CreateTimeHandler(Jim_Interp *interp, jim_wide milliseconds,
static jim_wide JimParseAfterId(Jim_Obj *idObj)
{
- int len;
- const char *tok = Jim_GetString(idObj, &len);
+ const char *tok = Jim_String(idObj);
jim_wide id;
if (strncmp(tok, "after#", 6) == 0 && Jim_StringToWide(tok + 6, &id, 10) == JIM_OK) {
@@ -557,9 +556,7 @@ static int JimELVwaitCommand(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
}
else {
/* If a result was left, it is an error */
- int len;
- Jim_GetString(interp->result, &len);
- if (len) {
+ if (Jim_Length(Jim_GetResult(interp))) {
return JIM_ERR;
}
}