Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
gthea committed Sep 15, 2023
1 parent 9c284d7 commit ee1d73c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
9 changes: 9 additions & 0 deletions src/main/java/io/split/android/client/SplitFactoryHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,15 @@ Pair<Map<SplitFilter.Type, SplitFilter>, String> getFilterConfiguration(SyncConf
return new Pair<>(groupedFilters, splitsFilterQueryString);
}

@Nullable
FlagSetsFilter getFlagSetsFilter(Map<SplitFilter.Type, SplitFilter> filters) {
if (filters.get(SplitFilter.Type.BY_SET) != null) {
return new FlagSetsFilterImpl(filters.get(SplitFilter.Type.BY_SET).getValues());
}

return null;
}

private TelemetryStorage getTelemetryStorage(boolean shouldRecordTelemetry, TelemetryStorage telemetryStorage) {
if (telemetryStorage != null) {
return telemetryStorage;
Expand Down
7 changes: 1 addition & 6 deletions src/main/java/io/split/android/client/SplitFactoryImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@

import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import io.split.android.client.api.Key;
import io.split.android.client.common.CompressionUtilProvider;
Expand Down Expand Up @@ -180,10 +178,7 @@ public void taskExecuted(@NonNull SplitTaskExecutionInfo taskInfo) {
SplitApiFacade splitApiFacade = factoryHelper.buildApiFacade(
config, defaultHttpClient, splitsFilterQueryStringFromConfig);

FlagSetsFilter flagSetsFilter = null;
if (filters.get(SplitFilter.Type.BY_SET) != null) {
flagSetsFilter = new FlagSetsFilterImpl(filters.get(SplitFilter.Type.BY_SET).getValues());
}
FlagSetsFilter flagSetsFilter = factoryHelper.getFlagSetsFilter(filters);

SplitTaskFactory splitTaskFactory = new SplitTaskFactoryImpl(
config, splitApiFacade, mStorageContainer, splitsFilterQueryStringFromConfig, mEventsManagerCoordinator,
Expand Down

0 comments on commit ee1d73c

Please sign in to comment.