Branch: Tag:

2005-04-10

2005-04-10 03:38:54 by Martin Nilsson <mani@lysator.liu.se>

A few slight optimizations.

Rev: lib/modules/Sql.pmod/Sql.pike:1.80
Rev: lib/modules/Sql.pmod/sql_util.pmod:1.13

1:   /* -  * $Id: sql_util.pmod,v 1.12 2003/08/22 14:24:06 nilsson Exp $ +  * $Id: sql_util.pmod,v 1.13 2005/04/10 03:38:54 nilsson Exp $    *    * Some SQL utility functions.    * They are kept here to avoid circular references.
47:    if (!bindings)    return query;    function my_quote=(driver&&driver->quote?driver->quote:quote); -  v=Array.map(values(bindings), +  v=map(values(bindings),    lambda(mixed m) {    if(multisetp(m)) m = indices(m)[0];    return (stringp(m)? "'"+my_quote(m)+"'" : (string)m);    });    // Throws if mapping key is empty string. -  k=Array.map(indices(bindings),lambda(string s){ +  k=map(indices(bindings),lambda(string s){    return ( (stringp(s)&&s[0]==':') ?    s : ":"+s);    });    return replace(query,k,v);   }