Changeset: 8161ef7f398d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8161ef7f398d
Modified Files:
        monetdb5/modules/mal/pcre.c
Branch: default
Log Message:

Use headless BUN append


diffs (25 lines):

diff --git a/monetdb5/modules/mal/pcre.c b/monetdb5/modules/mal/pcre.c
--- a/monetdb5/modules/mal/pcre.c
+++ b/monetdb5/modules/mal/pcre.c
@@ -661,7 +661,7 @@ pcre_replace_bat(BAT **res, BAT *origin_
                throw(MAL, "pcre_replace_bat", MAL_MALLOC_FAIL);
        }
 
-       assert(origin_strs->htype==TYPE_void);
+       assert(origin_strs->htype==TYPE_void); // headless guard
        tmpbat = BATnew(origin_strs->htype, TYPE_str, BATcount(origin_strs), 
TRANSIENT);
        if( tmpbat==NULL) {
                my_pcre_free(pcre_code);
@@ -719,10 +719,10 @@ pcre_replace_bat(BAT **res, BAT *origin_
                        strncpy(replaced_str+k, origin_str+capture_offsets[j], 
len);
                        k += len;
                        replaced_str[k] = '\0';
-                       BUNins(tmpbat, BUNhead(origin_strsi, p), replaced_str, 
FALSE);
+                       BUNappend(tmpbat, replaced_str, FALSE);
                        GDKfree(replaced_str);
                } else { /* no captured substrings, copy the original string 
into new bat */
-                       BUNins(tmpbat, BUNhead(origin_strsi, p), origin_str, 
FALSE);
+                       BUNappend(tmpbat, origin_str, FALSE);
                }
        }
 
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to