Skip to content

Commit

Permalink
reduce json size
Browse files Browse the repository at this point in the history
  • Loading branch information
JPMoresmau committed Mar 8, 2012
1 parent d98edfd commit 19867d6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
Expand Up @@ -181,9 +181,11 @@ public boolean build1(IFile file){
LinkedList<String> command=new LinkedList<String>();
command.add("build1");
command.add("--file="+path);
//long t0=System.currentTimeMillis();
//command.add("--buildflags="+escapeFlags(i.getFlags()));
JSONArray arr=run(command,ARRAY);

//long t1=System.currentTimeMillis();
//BuildWrapperPlugin.logInfo("build:"+(t1-t0)+"ms");
if (arr!=null && arr.length()>1){
Set<IResource> ress=new HashSet<IResource>();
ress.add(file);
Expand Down
Expand Up @@ -31,21 +31,22 @@ public Location(JSONObject json) throws JSONException {
}

public Location(IFile f, JSONArray json) throws JSONException {
startLine=json.getInt(0);
startColumn=json.getInt(1)-1; // we're zero based, Haskell code 1 based
endLine=json.getInt(2);
endColumn=json.getInt(3)-1;// we're zero based, Haskell code 1 based
if (endColumn==-1 && endLine>startLine){
endLine--;
}
this.fileName = f.getLocation().toOSString();
this(f.getLocation().toOSString(),json);
}

public Location(String fn, JSONArray json) throws JSONException {
startLine=json.getInt(0);
startColumn=json.getInt(1)-1; // we're zero based, Haskell code 1 based
endLine=json.getInt(2);
endColumn=json.getInt(3)-1;// we're zero based, Haskell code 1 based
if (json.length()>3){
endLine=json.getInt(2);
endColumn=json.getInt(3)-1;// we're zero based, Haskell code 1 based
} else if (json.length()>2){
endLine=startLine;
endColumn=json.getInt(2)-1;// we're zero based, Haskell code 1 based
} else {
endLine=startLine;
endColumn=startColumn+1;
}
if (endColumn==-1 && endLine>startLine){
endLine--;
}
Expand Down

0 comments on commit 19867d6

Please sign in to comment.