| 249 | } |
| 250 | |
| 251 | Function * |
| 252 | Function::get_one_function(const vector<Function *> &ok_funcs) |
| 253 | { |
| 254 | vector<Function *>::size_type ok_size = ok_funcs.size(); |
| 255 | |
| 256 | if (ok_size == 0) { |
| 257 | return 0; |
| 258 | } |
| 259 | if (ok_size == 1) { |
| 260 | return ok_funcs[0]; |
| 261 | } |
| 262 | int index = rnd_upto(ok_size); |
| 263 | return ok_funcs[index]; |
| 264 | } |
| 265 | |
| 266 | /* |
| 267 | * Choose a function from `funcs' to invoke. |