Removed duplicate code in switch/case statements

This commit is contained in:
Alessandro Casale
2013-03-11 19:24:42 +01:00
parent 72e448ab7f
commit e721e0a274
2 changed files with 2 additions and 6 deletions

View File

@@ -118,15 +118,13 @@ CpuTemperature.prototype = {
if (n!=0){//if temperature is detected
switch (settings.get_string('show-in-panel'))
{
case 'Average':
this.title=this._formatTemp(s/n);//set title as average
break;
case 'Maximum':
this.title=this._formatTemp(smax);//or the maximum temp
break;
case 'Sensor':
this.title=this._formatTemp(sel);//or temperature from a selected sensor
break;
case 'Average':
default:
this.title=this._formatTemp(s/n);//average as default
break;

View File

@@ -104,15 +104,13 @@ const CPUTemperaturePrefsWidget = new GObject.Class({
sensorRadio.connect('toggled', Lang.bind(this, this._onMethodChanged));
switch(this._settings.get_string('show-in-panel'))
{
case 'Average':
averageRadio.active = true;
break;
case 'Maximum':
maximumRadio.active = true;
break;
case 'Sensor':
sensorRadio.active = true;
break;
case 'Average':
default: //average temp is default
averageRadio.active = true;
break;