Save for errors, ftrigr_update() should return the number of ids for which something happened, as the doc says, i.e. the length of the list of ids. So this is what the attached patch does.
Good catch, thanks. I'm not convinced that there isn't a simpler or non-quadratic way of handling this, though; but I'm busy this week-end. I'll think about it next week, and push a fix - either your patch or something similar. -- Laurent