Skip to content

Commit 896cbfd

Browse files
committed
Code review updates
1 parent 6dc76cd commit 896cbfd

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

WooCommerce/Classes/Model/OrderStats+Woo.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ extension OrderStats {
2121

2222
/// Returns the sum of total sales this stats period. This value is typically used in the dashboard for revenue reporting.
2323
///
24-
/// *Note:* The value returned here is an aggrigation of all the `OrderStatsItem.totalSales` values and
24+
/// *Note:* The value returned here is an aggregation of all the `OrderStatsItem.totalSales` values and
2525
/// _not_ `OrderStats.totalGrossSales` or `OrderStats.totalNetSales`.
2626
///
2727
var totalSales: Double {

WooCommerce/Classes/ViewRelated/Dashboard/MyStore/ChartMarker.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ class ChartMarker: MarkerImage {
3434
var offset = self.offset
3535
var size = self.size
3636

37-
if size.width == 0.0 && image != nil {
38-
size.width = image!.size.width
37+
if let image = image, size.width == 0.0 {
38+
size.width = image.size.width
3939
}
4040

41-
if size.height == 0.0 && image != nil {
42-
size.height = image!.size.height
41+
if let image = image, size.height == 0.0 {
42+
size.height = image.size.height
4343
}
4444

4545
let width = size.width

WooCommerce/Classes/ViewRelated/Dashboard/MyStore/PeriodDataViewController.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,7 @@ class PeriodDataViewController: UIViewController, IndicatorInfoProvider {
8787
//
8888
extension PeriodDataViewController {
8989
func clearAllFields() {
90-
if barChartView != nil {
91-
barChartView.clear()
92-
}
90+
barChartView?.clear()
9391
orderStats = nil
9492
siteStats = nil
9593
reloadAllFields()
@@ -185,7 +183,7 @@ extension PeriodDataViewController: ChartViewDelegate {
185183
return
186184
}
187185

188-
let marker: ChartMarker = ChartMarker(color: StyleManager.wooSecondary,
186+
let marker = ChartMarker(color: StyleManager.wooSecondary,
189187
font: StyleManager.chartLabelFont,
190188
textColor: StyleManager.wooWhite,
191189
insets: Constants.chartMarkerInsets)

0 commit comments

Comments
 (0)