diff options
author | Keith Dahlby <dahlbyk@gmail.com> | 2013-02-14 06:39:47 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2013-02-14 10:47:34 +0400 |
commit | 9170dd60787072f87c10191f9363962d74bcc9d9 (patch) | |
tree | 0cfab2848b10b4c2663ddb5f093487f41d3e4386 /LibGit2Sharp/OdbBackend.cs | |
parent | 8f622a80c7707c2257afd03351dec9910b054531 (diff) |
Use readonly for applicable fields
Diffstat (limited to 'LibGit2Sharp/OdbBackend.cs')
-rw-r--r-- | LibGit2Sharp/OdbBackend.cs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/LibGit2Sharp/OdbBackend.cs b/LibGit2Sharp/OdbBackend.cs index 02f74dfc..73315248 100644 --- a/LibGit2Sharp/OdbBackend.cs +++ b/LibGit2Sharp/OdbBackend.cs @@ -184,15 +184,15 @@ namespace LibGit2Sharp // to native memory with StructureToPtr), we need to bind to static delegates. If at construction time // we were to bind to the methods directly, that's the same as newing up a fresh delegate every time. // Those delegates won't be rooted in the object graph and can be collected as soon as StructureToPtr finishes. - public static GitOdbBackend.read_callback ReadCallback = new GitOdbBackend.read_callback(Read); - public static GitOdbBackend.read_prefix_callback ReadPrefixCallback = new GitOdbBackend.read_prefix_callback(ReadPrefix); - public static GitOdbBackend.read_header_callback ReadHeaderCallback = new GitOdbBackend.read_header_callback(ReadHeader); - public static GitOdbBackend.readstream_callback ReadStreamCallback = new GitOdbBackend.readstream_callback(ReadStream); - public static GitOdbBackend.write_callback WriteCallback = new GitOdbBackend.write_callback(Write); - public static GitOdbBackend.writestream_callback WriteStreamCallback = new GitOdbBackend.writestream_callback(WriteStream); - public static GitOdbBackend.exists_callback ExistsCallback = new GitOdbBackend.exists_callback(Exists); - public static GitOdbBackend.foreach_callback ForEachCallback = new GitOdbBackend.foreach_callback(Foreach); - public static GitOdbBackend.free_callback FreeCallback = new GitOdbBackend.free_callback(Free); + public static readonly GitOdbBackend.read_callback ReadCallback = new GitOdbBackend.read_callback(Read); + public static readonly GitOdbBackend.read_prefix_callback ReadPrefixCallback = new GitOdbBackend.read_prefix_callback(ReadPrefix); + public static readonly GitOdbBackend.read_header_callback ReadHeaderCallback = new GitOdbBackend.read_header_callback(ReadHeader); + public static readonly GitOdbBackend.readstream_callback ReadStreamCallback = new GitOdbBackend.readstream_callback(ReadStream); + public static readonly GitOdbBackend.write_callback WriteCallback = new GitOdbBackend.write_callback(Write); + public static readonly GitOdbBackend.writestream_callback WriteStreamCallback = new GitOdbBackend.writestream_callback(WriteStream); + public static readonly GitOdbBackend.exists_callback ExistsCallback = new GitOdbBackend.exists_callback(Exists); + public static readonly GitOdbBackend.foreach_callback ForEachCallback = new GitOdbBackend.foreach_callback(Foreach); + public static readonly GitOdbBackend.free_callback FreeCallback = new GitOdbBackend.free_callback(Free); private unsafe static int Read( out IntPtr buffer_p, @@ -539,10 +539,10 @@ namespace LibGit2Sharp return cb(ref gitOid, data); } - public ForEachCallback ManagedCallback; + public readonly ForEachCallback ManagedCallback; - private GitOdbBackend.foreach_callback_callback cb; - private IntPtr data; + private readonly GitOdbBackend.foreach_callback_callback cb; + private readonly IntPtr data; } } |