mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-22 00:15:25 +02:00
Removed redundant initialization.
This commit is contained in:
parent
a0e5d03137
commit
ea20a818cf
1 changed files with 8 additions and 12 deletions
|
@ -103,15 +103,11 @@ public class PDOMFile implements IIndexFragmentFile {
|
||||||
Database db = fLinkage.getDB();
|
Database db = fLinkage.getDB();
|
||||||
record = db.malloc(RECORD_SIZE);
|
record = db.malloc(RECORD_SIZE);
|
||||||
String locationString = fLinkage.getPDOM().getLocationConverter().toInternalFormat(location);
|
String locationString = fLinkage.getPDOM().getLocationConverter().toInternalFormat(location);
|
||||||
if (locationString==null)
|
if (locationString == null)
|
||||||
throw new CoreException(CCorePlugin.createStatus(Messages.getString("PDOMFile.toInternalProblem")+location.getURI())); //$NON-NLS-1$
|
throw new CoreException(CCorePlugin.createStatus(Messages.getString("PDOMFile.toInternalProblem") + location.getURI())); //$NON-NLS-1$
|
||||||
IString locationDBString = db.newString(locationString);
|
IString locationDBString = db.newString(locationString);
|
||||||
db.putRecPtr(record + LOCATION_REPRESENTATION, locationDBString.getRecord());
|
db.putRecPtr(record + LOCATION_REPRESENTATION, locationDBString.getRecord());
|
||||||
db.putInt(record + LINKAGE_ID, linkageID);
|
db.putInt(record + LINKAGE_ID, linkageID);
|
||||||
db.putLong(record + TIME_STAMP, 0);
|
|
||||||
setFirstName(null);
|
|
||||||
setFirstInclude(null);
|
|
||||||
setFirstIncludedBy(null);
|
|
||||||
setTimestamp(-1);
|
setTimestamp(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -456,7 +452,7 @@ public class PDOMFile implements IIndexFragmentFile {
|
||||||
for (PDOMName name= getFirstName(); name != null; name= name.getNextInFile()) {
|
for (PDOMName name= getFirstName(); name != null; name= name.getNextInFile()) {
|
||||||
int nameOffset= name.getNodeOffset();
|
int nameOffset= name.getNodeOffset();
|
||||||
if (nameOffset >= offset) {
|
if (nameOffset >= offset) {
|
||||||
if (nameOffset + name.getNodeLength() <= offset+length) {
|
if (nameOffset + name.getNodeLength() <= offset + length) {
|
||||||
result.add(name);
|
result.add(name);
|
||||||
} else if (name.isReference()) {
|
} else if (name.isReference()) {
|
||||||
// names are ordered, but callers are inserted before
|
// names are ordered, but callers are inserted before
|
||||||
|
@ -469,7 +465,7 @@ public class PDOMFile implements IIndexFragmentFile {
|
||||||
for (PDOMMacro macro= getFirstMacro(); macro != null; macro= macro.getNextMacro()) {
|
for (PDOMMacro macro= getFirstMacro(); macro != null; macro= macro.getNextMacro()) {
|
||||||
int nameOffset= macro.getNodeOffset();
|
int nameOffset= macro.getNodeOffset();
|
||||||
if (nameOffset >= offset) {
|
if (nameOffset >= offset) {
|
||||||
if (nameOffset + macro.getNodeLength() <= offset+length) {
|
if (nameOffset + macro.getNodeLength() <= offset + length) {
|
||||||
IIndexFragmentName name= macro.getDefinition();
|
IIndexFragmentName name= macro.getDefinition();
|
||||||
if (name != null) {
|
if (name != null) {
|
||||||
result.add(name);
|
result.add(name);
|
||||||
|
@ -482,7 +478,7 @@ public class PDOMFile implements IIndexFragmentFile {
|
||||||
for (PDOMMacroReferenceName name= getFirstMacroReference(); name != null; name= name.getNextInFile()) {
|
for (PDOMMacroReferenceName name= getFirstMacroReference(); name != null; name= name.getNextInFile()) {
|
||||||
int nameOffset= name.getNodeOffset();
|
int nameOffset= name.getNodeOffset();
|
||||||
if (nameOffset >= offset) {
|
if (nameOffset >= offset) {
|
||||||
if (nameOffset + name.getNodeLength() <= offset+length) {
|
if (nameOffset + name.getNodeLength() <= offset + length) {
|
||||||
result.add(name);
|
result.add(name);
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
|
@ -579,9 +575,9 @@ public class PDOMFile implements IIndexFragmentFile {
|
||||||
} else if (this.records == null) {
|
} else if (this.records == null) {
|
||||||
this.records= new long[] {this.record, record};
|
this.records= new long[] {this.record, record};
|
||||||
} else {
|
} else {
|
||||||
long[] cpy= new long[this.records.length+1];
|
long[] cpy= new long[this.records.length + 1];
|
||||||
System.arraycopy(this.records, 0, cpy, 0, this.records.length);
|
System.arraycopy(this.records, 0, cpy, 0, this.records.length);
|
||||||
cpy[cpy.length-1]= record;
|
cpy[cpy.length - 1]= record;
|
||||||
this.records= cpy;
|
this.records= cpy;
|
||||||
}
|
}
|
||||||
return linkageID < 0;
|
return linkageID < 0;
|
||||||
|
@ -601,7 +597,7 @@ public class PDOMFile implements IIndexFragmentFile {
|
||||||
URI uri;
|
URI uri;
|
||||||
try {
|
try {
|
||||||
int idx= raw.lastIndexOf('>');
|
int idx= raw.lastIndexOf('>');
|
||||||
uri= new URI("file", null, raw.substring(idx+1), null); //$NON-NLS-1$
|
uri= new URI("file", null, raw.substring(idx + 1), null); //$NON-NLS-1$
|
||||||
} catch (URISyntaxException e) {
|
} catch (URISyntaxException e) {
|
||||||
uri= URI.create("file:/unknown-location"); //$NON-NLS-1$
|
uri= URI.create("file:/unknown-location"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue