- Give code a round of indentation. Thank astyle, not me.

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@837 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-08-09 14:38:45 +00:00
parent aaf8e068d3
commit d3c7b46853
108 changed files with 3196 additions and 3180 deletions

View file

@ -27,48 +27,48 @@ using sgpem::ReadyQueue;
void
ReadyQueue::swap(position a, position b)
throw (std::out_of_range)
throw (std::out_of_range)
{
if(a == b) return;
// Usage of "at()" isn't casual:
// at() checks indexes, "[]" doesn't.
// Once we've done the check once, we
// can assume it's safe to use "[]";
// this for performance reasons.
Thread* temp = _scheds.at(a);
_scheds[a] = _scheds.at(b);
_scheds[b] = temp;
if (a == b) return;
// Usage of "at()" isn't casual:
// at() checks indexes, "[]" doesn't.
// Once we've done the check once, we
// can assume it's safe to use "[]";
// this for performance reasons.
Thread* temp = _scheds.at(a);
_scheds[a] = _scheds.at(b);
_scheds[b] = temp;
}
ReadyQueue::size_t
ReadyQueue::size() const
{
return _scheds.size();
return _scheds.size();
}
sgpem::Thread&
ReadyQueue::get_item_at(position index)
throw (std::out_of_range)
throw (std::out_of_range)
{
// Checks index access
return *_scheds.at(index);
// Checks index access
return *_scheds.at(index);
}
const sgpem::Thread&
ReadyQueue::get_item_at(position index) const
throw (std::out_of_range)
throw (std::out_of_range)
{
// Checks index access
return *_scheds.at(index);
// Checks index access
return *_scheds.at(index);
}
void
ReadyQueue::append(Thread& thread)
{
_scheds.push_back(&thread);
_scheds.push_back(&thread);
}
void