Skip to content

Commit fae89aa

Browse files
committed
Small syntax optimizations and improvment
- Remove unused variable - Simplify logic
1 parent 0fdccb9 commit fae89aa

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

OpenEphys.Onix1/AutoPortVoltage.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@ internal class PortVoltageConverter : TypeConverter
4545
{
4646
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
4747
{
48-
if (destinationType == typeof(string))
49-
return true;
50-
51-
return base.CanConvertTo(context, destinationType);
48+
return destinationType == typeof(string) || base.CanConvertTo(context, destinationType);
5249
}
5350

5451
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)

OpenEphys.Onix1/ConfigurePortController.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ public override IObservable<ContextTask> Process(IObservable<ContextTask> source
8282
.GetField(port.ToString())?
8383
.GetCustomAttribute<DescriptionAttribute>()?
8484
.Description ?? "Address " + deviceAddress.ToString();
85-
var appliedVoltage = PortVoltage.Applied;
8685
var message = portVoltage.Requested.HasValue ?
8786
$"Unable to acquire communication lock on {portString}" :
8887
$"Unable to acquire communication lock on {portString}. You may need to manually specify a PortVoltage greater than {PortVoltage.Applied} volts, the maximum automatic value for this device.";

0 commit comments

Comments
 (0)