This is what I would do to simplify this function:

```c++
// add "cyclus::Material::Ptr spare_;" member
void BatchReactor::AddBatches_(cyclus::Material::Ptr mat) {
  LOG(cyclus::LEV_DEBUG3, "BReact") << "BatchReactor " << name()
                                    << " is adding " << mat->quantity()
                                    << " of material to its reserves.";
  if (spare_ != NULL) {
    spare_.Absorb(mat);
  } else {
    spare_ = mat;
  }
  while (spare_->quantity() > batch_size()) {
    Material::Ptr batch = spare_->ExtractQty(batch_size());
    reserves_.Push(batch);    
  }
}
```