Skip to content
Snippets Groups Projects
Commit 8f114753 authored by Ben Boeckel's avatar Ben Boeckel
Browse files

vtkPostgreSQLDatabase: factor out clamping

parent aad39093
No related branches found
No related tags found
No related merge requests found
......@@ -282,9 +282,10 @@ vtkSetStringPlusMTimeMacro(vtkPostgreSQLDatabase, ConnectOptions, URLMTime);
inline void vtkPostgreSQLDatabase::SetServerPort(int _arg)
{
vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting ServerPort to " << _arg);
if (this->ServerPort != (_arg < 0 ? 0 : (_arg > VTK_INT_MAX ? VTK_INT_MAX : _arg)))
_arg = std::min(std::max(_arg, 0), VTK_INT_MAX);
if (this->ServerPort != _arg)
{
this->ServerPort = (_arg < 0 ? 0 : (_arg > VTK_INT_MAX ? VTK_INT_MAX : _arg));
this->ServerPort = _arg;
this->Modified();
this->URLMTime.Modified();
this->Close(); // Force a re-open on next query
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment