Skip to content

Commit f8bea68

Browse files
ma2bdfacebook-github-bot
authored andcommitted
fbcode: remove unused includes from .cpp files with no #if and #define
Summary: This is a first diff to remove the "easiest" unused includes in fbcode. * For safety, we only touch .cpp files without #if and #define, * We do not try to remove redundant systems headers (aka. "packing"). The diff was generated as follows: ``` foundation/scripts/ls-cpp-dirs | grep -v '^\(\.\.\|external/\|.*/external\)' | xargs ffmr -o /tmp/ffmr-diff-1 codegraph/scripts/ffmr/analyze_includes_no_headers_no_packing_skipping_ifdefs.sh cat /tmp/ffmr-diff-1/*.diff | patch -p2 hg commit -m something arc diff --prepare --nolint --nounit --less-context --excuse refactoring ``` Note: `grep -v` is just an optimization. The actual configuration is in these two files: diffusion/FBS/browse/master/fbcode/codegraph/analysis/config.py diffusion/FBS/browse/master/fbcode/codegraph/scripts/ffmr/analyze_includes_no_headers_no_packing_skipping_ifdefs.sh See the task for more context, and the recent "safety" improvements on the tool. depends on D4317825 for very few cases where `nolint` had to be manually added. Reviewed By: igorsugak Differential Revision: D4312617 fbshipit-source-id: ecc1f0addfd0651fa4770fcc43cd1314661a311a
1 parent fa8fbe1 commit f8bea68

File tree

3 files changed

+0
-3
lines changed

3 files changed

+0
-3
lines changed

src/dictionary.cc

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include <algorithm>
1616
#include <iterator>
1717
#include <unordered_map>
18-
#include <cctype>
1918

2019
namespace fasttext {
2120

src/fasttext.cc

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#include "fasttext.h"
1111

12-
#include <fenv.h>
1312
#include <math.h>
1413

1514
#include <iostream>

src/utils.cc

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
#include "utils.h"
1111

12-
#include <cmath>
1312
#include <ios>
1413

1514
namespace fasttext {

0 commit comments

Comments
 (0)